using System;
using System.IO;
namespace Swan {
///
/// Provides utility methods to retrieve information about the current application.
///
public static class SwanRuntime {
// [Obsolete("NEED", false)]
private static OperatingSystem? _oS;
#region Properties
///
/// Gets the current Operating System.
///
///
/// The os.
///
// [Obsolete("NEED", false)]
public static OperatingSystem OS {
get {
if(_oS.HasValue == false) {
String windowsDirectory = Environment.GetEnvironmentVariable("windir");
_oS = String.IsNullOrEmpty(windowsDirectory) == false && windowsDirectory.Contains(@"\") && Directory.Exists(windowsDirectory)
? (OperatingSystem?)OperatingSystem.Windows
: (OperatingSystem?)(File.Exists(@"/proc/sys/kernel/ostype") ? OperatingSystem.Unix : OperatingSystem.Osx);
}
return _oS ?? OperatingSystem.Unknown;
}
}
#endregion
}
}