2 * Copyright(c) 2021 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 using System.Reflection;
22 namespace Tizen.NUI.Binding.Internals
24 internal static class ResourceLoader
26 static Func<AssemblyName, string, string> resourceProvider = (asmName, path) =>
28 if (typeof(Theme).Assembly.GetName().FullName != asmName.FullName)
30 string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
31 path = resource + path;
34 string ret = File.ReadAllText(path);
38 //takes a resource path, returns string content
39 public static Func<AssemblyName, string, string> ResourceProvider
41 get => resourceProvider;
44 DesignMode.IsDesignModeEnabled = true;
45 resourceProvider = value;
49 internal static Action<Exception> ExceptionHandler { get; set; }