Follow formatting NUI
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / XamlBinding / Internals / ResourceLoader.cs
1 using System;
2 using System.IO;
3 using System.Reflection;
4 using Tizen.NUI.Xaml;
5
6 namespace Tizen.NUI.Binding.Internals
7 {
8     internal static class ResourceLoader
9     {
10         static Func<AssemblyName, string, string> resourceProvider = (asmName, path) =>
11         {
12             if (typeof(Theme).Assembly.GetName().FullName != asmName.FullName)
13             {
14                 string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
15                 path = resource + path;
16             }
17
18             string ret = File.ReadAllText(path);
19             return ret;
20         };
21
22         //takes a resource path, returns string content
23         public static Func<AssemblyName, string, string> ResourceProvider
24         {
25             get => resourceProvider;
26             internal set
27             {
28                 DesignMode.IsDesignModeEnabled = true;
29                 resourceProvider = value;
30             }
31         }
32
33         internal static Action<Exception> ExceptionHandler { get; set; }
34     }
35 }