Exemplo n.º 1
0
        public static IOrientationProvider InitControlPrivider(FrameworkElement control)
        {
            if (control == null)
                return null;
            if (ProviderCollection.Providers.ContainsKey(control.GetType()))
            {
                IOrientationProvider provider = typeof(IOrientationProvider).Assembly.CreateInstance(ProviderCollection.Providers[control.GetType()]) as IOrientationProvider;

                return provider;
            }
            else
            {
                IOrientationProvider provider = new ElementOrientationProvider();//如果找不到对于的Provider 则使用默认元素Provider

                return provider;
            }
        }
Exemplo n.º 2
0
        public static IOrientationProvider InitControlPrivider(FrameworkElement control)
        {
            if (control == null)
            {
                return(null);
            }
            if (ProviderCollection.Providers.ContainsKey(control.GetType()))
            {
                IOrientationProvider provider = typeof(IOrientationProvider).Assembly.CreateInstance(ProviderCollection.Providers[control.GetType()]) as IOrientationProvider;

                return(provider);
            }
            else
            {
                IOrientationProvider provider = new ElementOrientationProvider();//如果找不到对于的Provider 则使用默认元素Provider

                return(provider);
            }
        }