private static WinRTSynchronizationContextFactoryBase GetWinRTSynchronizationContextFactory()
        {
            WinRTSynchronizationContextFactoryBase contextFactoryBase = SynchronizationContext.s_winRTContextFactory;

            if (contextFactoryBase == null)
            {
                SynchronizationContext.s_winRTContextFactory = contextFactoryBase = (WinRTSynchronizationContextFactoryBase)Activator.CreateInstance(Type.GetType("System.Threading.WinRTSynchronizationContextFactory, System.Runtime.WindowsRuntime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", true), true);
            }
            return(contextFactoryBase);
        }
        private static WinRTSynchronizationContextFactoryBase GetWinRTSynchronizationContextFactory()
        {
            //
            // Since we can't directly reference System.Runtime.WindowsRuntime from mscorlib, we have to get the factory via reflection.
            // It would be better if we could just implement WinRTSynchronizationContextFactory in mscorlib, but we can't, because
            // we can do very little with WinRT stuff in mscorlib.
            //
            WinRTSynchronizationContextFactoryBase factory = s_winRTContextFactory;

            if (factory == null)
            {
                Type factoryType = Type.GetType("System.Threading.WinRTSynchronizationContextFactory, " + AssemblyRef.SystemRuntimeWindowsRuntime, true);
                s_winRTContextFactory = factory = (WinRTSynchronizationContextFactoryBase)Activator.CreateInstance(factoryType, true);
            }
            return(factory);
        }
 private static WinRTSynchronizationContextFactoryBase GetWinRTSynchronizationContextFactory()
 {
     //
     // Since we can't directly reference System.Runtime.WindowsRuntime from mscorlib, we have to get the factory via reflection.
     // It would be better if we could just implement WinRTSynchronizationContextFactory in mscorlib, but we can't, because
     // we can do very little with WinRT stuff in mscorlib.
     //
     WinRTSynchronizationContextFactoryBase factory = s_winRTContextFactory;
     if (factory == null)
     {
         Type factoryType = Type.GetType("System.Threading.WinRTSynchronizationContextFactory, " + AssemblyRef.SystemRuntimeWindowsRuntime, true);
         s_winRTContextFactory = factory = (WinRTSynchronizationContextFactoryBase)Activator.CreateInstance(factoryType, true);
     }
     return factory;
 }