コード例 #1
0
 static PlatformMethods()
 {
     if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
     {
         Instance = new WindowsPlatformMethods();
     }
     else
     {
         Instance = new PosixPlatformMethods();
     }
 }
コード例 #2
0
        static PlatformMethods()
        {
#if NETCOREAPP
            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                Instance = new WindowsPlatformMethods();
            }
            else
            {
                Instance = new PosixPlatformMethods();
            }
#else
            Instance = new WindowsPlatformMethods();
#endif
        }