2 using System.ComponentModel;
3 using System.Reflection;
4 using System.Runtime.CompilerServices;
6 namespace Tizen.NUI.Xaml
8 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
9 [EditorBrowsable(EditorBrowsableState.Never)]
11 public enum XamlCompilationOptions
13 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
14 [EditorBrowsable(EditorBrowsableState.Never)]
17 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
18 [EditorBrowsable(EditorBrowsableState.Never)]
22 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
23 [EditorBrowsable(EditorBrowsableState.Never)]
24 [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class, Inherited = false)]
25 public sealed class XamlCompilationAttribute : Attribute
27 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
28 [EditorBrowsable(EditorBrowsableState.Never)]
29 public XamlCompilationAttribute(XamlCompilationOptions xamlCompilationOptions)
31 XamlCompilationOptions = xamlCompilationOptions;
34 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
35 [EditorBrowsable(EditorBrowsableState.Never)]
36 public XamlCompilationOptions XamlCompilationOptions { get; set; }
39 internal static class XamlCExtensions
41 public static bool IsCompiled(this Type type)
43 var attr = type.GetTypeInfo().GetCustomAttribute<XamlCompilationAttribute>();
45 return attr.XamlCompilationOptions == XamlCompilationOptions.Compile;
46 attr = type.GetTypeInfo().Module.GetCustomAttribute<XamlCompilationAttribute>();
48 return attr.XamlCompilationOptions == XamlCompilationOptions.Compile;
49 attr = type.GetTypeInfo().Assembly.GetCustomAttribute<XamlCompilationAttribute>();
51 return attr.XamlCompilationOptions == XamlCompilationOptions.Compile;