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();
            }
        }
 private static string GetComponentName(Type type)
 {
     return(ComponentAttribute.FromType(type).Name ?? type.Name);
 }