コード例 #1
0
        private static bool GetComponentUiThreadAffinity(Type type, ComponentRepository repository)
        {
            ThreadAffinity ThreadAffinity = ComponentAttribute.FromType(type).ThreadAffinity;

            switch (ThreadAffinity)
            {
            case ThreadAffinity.Automatic:
                return(repository.MustRunOnUiThread(type));

            case ThreadAffinity.NeedsUiThread:
                return(true);

            case ThreadAffinity.SupportsBackground:
                return(false);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
コード例 #2
0
 private static string GetComponentName(Type type)
 {
     return(ComponentAttribute.FromType(type).Name ?? type.Name);
 }