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); }
public static T PlatformSwitch <T>(Func <T> windows, Func <T> nonWindows) { var platform = OSHelper.GetPlatform(); var output = OSHelper.PlatformSwitch(platform, windows, nonWindows); return(output); }
public static Platform GetPlatform() { var osPlatform = OSHelper.GetOSPlatform(); var platform = OSHelper.GetPlatform(osPlatform); return(platform); }
public static void DisplayOSName(StreamWriter writer) { OSHelper.OSPlatformSwitch( () => { writer.WriteLine(@"OS: Windows"); }, () => { writer.WriteLine(@"OS: OSX (Mac)"); }, () => { writer.WriteLine(@"OS: Linux"); }); }
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); }
public static Platform GetPlatform(OSPlatform osPlatform) { var platform = OSHelper.OSPlatformSwitch(osPlatform, () => { return(Platform.Windows); }, () => { return(Platform.NonWindows); }, () => { return(Platform.NonWindows); }); return(platform); }
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); }
public static void OSPlatformSwitch(Action windows, Action osx, Action linux) { var osPlatform = OSHelper.GetOSPlatform(); OSHelper.OSPlatformSwitch(osPlatform, windows, osx, linux); }
public static void PlatformSwitch(Action windows, Action nonWindows) { var platform = OSHelper.GetPlatform(); OSHelper.PlatformSwitch(platform, windows, nonWindows); }