Exemple #1
0
        public static T OSPlatformSwitch <T>(Func <T> windows, Func <T> osx, Func <T> linux)
        {
            var osPlatform = OSHelper.GetOSPlatform();

            var output = OSHelper.OSPlatformSwitch(osPlatform, windows, osx, linux);

            return(output);
        }
Exemple #2
0
        public static T PlatformSwitch <T>(Func <T> windows, Func <T> nonWindows)
        {
            var platform = OSHelper.GetPlatform();

            var output = OSHelper.PlatformSwitch(platform, windows, nonWindows);

            return(output);
        }
Exemple #3
0
        public static Platform GetPlatform()
        {
            var osPlatform = OSHelper.GetOSPlatform();

            var platform = OSHelper.GetPlatform(osPlatform);

            return(platform);
        }
Exemple #4
0
 public static void DisplayOSName(StreamWriter writer)
 {
     OSHelper.OSPlatformSwitch(
         () =>
     {
         writer.WriteLine(@"OS: Windows");
     },
         () =>
     {
         writer.WriteLine(@"OS: OSX (Mac)");
     },
         () =>
     {
         writer.WriteLine(@"OS: Linux");
     });
 }
Exemple #5
0
        public static T PlatformSwitch <T>(Platform platform, Func <T> windows, Func <T> nonWindows)
        {
            T output = default;

            OSHelper.PlatformSwitch(platform,
                                    () =>
            {
                output = windows();
            },
                                    () =>
            {
                output = nonWindows();
            });

            return(output);
        }
Exemple #6
0
        public static Platform GetPlatform(OSPlatform osPlatform)
        {
            var platform = OSHelper.OSPlatformSwitch(osPlatform,
                                                     () =>
            {
                return(Platform.Windows);
            },
                                                     () =>
            {
                return(Platform.NonWindows);
            },
                                                     () =>
            {
                return(Platform.NonWindows);
            });

            return(platform);
        }
Exemple #7
0
        public static T OSPlatformSwitch <T>(OSPlatform osPlatform, Func <T> windows, Func <T> osx, Func <T> linux)
        {
            T output = default;

            OSHelper.OSPlatformSwitch(osPlatform,
                                      () =>
            {
                output = windows();
            },
                                      () =>
            {
                output = osx();
            },
                                      () =>
            {
                output = linux();
            });

            return(output);
        }
Exemple #8
0
        public static void OSPlatformSwitch(Action windows, Action osx, Action linux)
        {
            var osPlatform = OSHelper.GetOSPlatform();

            OSHelper.OSPlatformSwitch(osPlatform, windows, osx, linux);
        }
Exemple #9
0
        public static void PlatformSwitch(Action windows, Action nonWindows)
        {
            var platform = OSHelper.GetPlatform();

            OSHelper.PlatformSwitch(platform, windows, nonWindows);
        }