mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 21:24:58 +00:00
add bool and ushort extensions
This commit is contained in:
10
ICD.Common.Utils/Extensions/BoolExtensions.cs
Normal file
10
ICD.Common.Utils/Extensions/BoolExtensions.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
namespace ICD.Common.Utils.Extensions
|
||||||
|
{
|
||||||
|
public static class BoolExtensions
|
||||||
|
{
|
||||||
|
public static ushort ToUshort(this bool b)
|
||||||
|
{
|
||||||
|
return b ? (ushort)1 : (ushort)0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
10
ICD.Common.Utils/Extensions/UshortExtensions.cs
Normal file
10
ICD.Common.Utils/Extensions/UshortExtensions.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
namespace ICD.Common.Utils.Extensions
|
||||||
|
{
|
||||||
|
public static class UshortExtensions
|
||||||
|
{
|
||||||
|
public static bool ToBool(this ushort u)
|
||||||
|
{
|
||||||
|
return u != 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user