mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +00:00
add bool and ushort extensions
This commit is contained in:
parent
d22c3c2cd2
commit
9b1ddf41d2
2 changed files with 20 additions and 0 deletions
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue