mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-12 19:25:00 +00:00
feat: Adding eDaysOfWeek enum
This commit is contained in:
committed by
Chris Cameron
parent
f0bcb3bbc9
commit
a13f1fd687
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||
- Added property to IcdEnvironment to determine whether SSL communication is enabled
|
||||
- Added IcdTimeZoneInfo, a very light implementation of System.TimeZoneInfo for the .NET Compact Framework
|
||||
- Added ThreadedWorkerQueue - a threadsafe way to enqueue items and have a worker thread process them one at a time
|
||||
- Added eDaysOfWeek flags enum
|
||||
|
||||
### Changed
|
||||
- Repeater changed to use configured callbacks instead of a dumb event
|
||||
|
||||
@@ -91,6 +91,7 @@
|
||||
<Compile Include="Comparers\UndefinedVersionEqualityComparer.cs" />
|
||||
<Compile Include="eConsoleColor.cs" />
|
||||
<Compile Include="DateTimeUtils.cs" />
|
||||
<Compile Include="eDaysOfWeek.cs" />
|
||||
<Compile Include="Email\EmailClient.cs" />
|
||||
<Compile Include="Email\eMailErrorCode.cs" />
|
||||
<Compile Include="Email\EmailStringCollection.cs" />
|
||||
|
||||
45
ICD.Common.Utils/eDaysOfWeek.cs
Normal file
45
ICD.Common.Utils/eDaysOfWeek.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
|
||||
namespace ICD.Common.Utils
|
||||
{
|
||||
[Flags]
|
||||
public enum eDaysOfWeek
|
||||
{
|
||||
None = 0,
|
||||
Sunday = 1,
|
||||
Monday = 2,
|
||||
Tuesday = 4,
|
||||
Wednesday = 8,
|
||||
Thursday = 16,
|
||||
Friday = 32,
|
||||
Saturday = 64,
|
||||
WeekDays = Monday | Tuesday | Wednesday | Thursday | Friday,
|
||||
WeekEnds = Saturday | Sunday
|
||||
}
|
||||
|
||||
public static class DaysOfWeekExtensions
|
||||
{
|
||||
public static eDaysOfWeek ToDaysOfWeek(this DayOfWeek extends)
|
||||
{
|
||||
switch (extends)
|
||||
{
|
||||
case DayOfWeek.Sunday:
|
||||
return eDaysOfWeek.Sunday;
|
||||
case DayOfWeek.Monday:
|
||||
return eDaysOfWeek.Monday;
|
||||
case DayOfWeek.Tuesday:
|
||||
return eDaysOfWeek.Tuesday;
|
||||
case DayOfWeek.Wednesday:
|
||||
return eDaysOfWeek.Wednesday;
|
||||
case DayOfWeek.Thursday:
|
||||
return eDaysOfWeek.Thursday;
|
||||
case DayOfWeek.Friday:
|
||||
return eDaysOfWeek.Friday;
|
||||
case DayOfWeek.Saturday:
|
||||
return eDaysOfWeek.Saturday;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException("extends");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user