2 using System.Reflection;
3 using System.Runtime.CompilerServices;
5 namespace Tizen.NUI.Xaml
8 internal enum XamlCompilationOptions
14 [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class, Inherited = false)]
15 internal sealed class XamlCompilationAttribute : Attribute
17 public XamlCompilationAttribute(XamlCompilationOptions xamlCompilationOptions)
19 XamlCompilationOptions = xamlCompilationOptions;
22 public XamlCompilationOptions XamlCompilationOptions { get; set; }
25 internal static class XamlCExtensions
27 public static bool IsCompiled(this Type type)
29 var attr = type.GetTypeInfo().GetCustomAttribute<XamlCompilationAttribute>();
31 return attr.XamlCompilationOptions == XamlCompilationOptions.Compile;
32 attr = type.GetTypeInfo().Module.GetCustomAttribute<XamlCompilationAttribute>();
34 return attr.XamlCompilationOptions == XamlCompilationOptions.Compile;
35 attr = type.GetTypeInfo().Assembly.GetCustomAttribute<XamlCompilationAttribute>();
37 return attr.XamlCompilationOptions == XamlCompilationOptions.Compile;