Esempio n. 1
0
        /*********
        ** Public methods
        *********/
        /// <summary>Detect the current OS.</summary>
        public static Platform DetectPlatform()
        {
            Platform?platform = EnvironmentUtility.CachedPlatform;

            if (platform == null)
            {
                string rawPlatform = LowLevelEnvironmentUtility.DetectPlatform();
                EnvironmentUtility.CachedPlatform = platform = (Platform)Enum.Parse(typeof(Platform), rawPlatform, ignoreCase: true);
            }

            return(platform.Value);
        }
Esempio n. 2
0
 /// <summary>Get whether the platform uses Mono.</summary>
 /// <param name="platform">The current platform.</param>
 public static bool IsMono(this Platform platform)
 {
     return(LowLevelEnvironmentUtility.IsMono(platform.ToString()));
 }
Esempio n. 3
0
 /// <summary>Get the name of the Stardew Valley executable.</summary>
 /// <param name="platform">The current platform.</param>
 public static string GetExecutableName(Platform platform)
 {
     return(LowLevelEnvironmentUtility.GetExecutableName(platform.ToString()));
 }
Esempio n. 4
0
 public static string GetFriendlyPlatformName(Platform platform)
 {
     return(LowLevelEnvironmentUtility.GetFriendlyPlatformName(platform.ToString()));
 }
Esempio n. 5
0
 /// <summary>Get whether an executable is 64-bit.</summary>
 /// <param name="path">The absolute path to the assembly file.</param>
 public static bool Is64BitAssembly(string path)
 {
     return(LowLevelEnvironmentUtility.Is64BitAssembly(path));
 }