1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-21 01:49:57 +02:00
Sonarr/NzbDrone.Common/EnvironmentInfo/OsInfo.cs
Mark McDowall fe5b42696d Auto detect first day of week for calendar
New: Calendar will use systems first day of week when displaying
2013-10-02 12:41:21 -07:00

40 lines
912 B
C#

using System;
namespace NzbDrone.Common.EnvironmentInfo
{
public static class OsInfo
{
static OsInfo()
{
Version = Environment.OSVersion.Version;
IsMono = Type.GetType("Mono.Runtime") != null;
int platform = (int)Environment.OSVersion.Platform;
IsLinux = (platform == 4) || (platform == 6) || (platform == 128);
}
public static Version Version { get; private set; }
public static bool IsMono { get; private set; }
public static bool IsLinux { get; private set; }
public static bool IsWindows
{
get
{
return !IsLinux;
}
}
public static DayOfWeek FirstDayOfWeek
{
get
{
return DateTime.Today.GetFirstDayOfWeek().DayOfWeek;
}
}
}
}