mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-15 04:35:00 +00:00
feat: Adding SPlusUtils to convert ushort's to int
This commit is contained in:
@@ -186,6 +186,7 @@
|
||||
<Compile Include="SafeCriticalSection.SimplSharp.cs" />
|
||||
<Compile Include="SafeCriticalSection.Standard.cs" />
|
||||
<Compile Include="SafeMutex.cs" />
|
||||
<Compile Include="SPlusUtils.cs" />
|
||||
<Compile Include="Sqlite\eDbType.cs" />
|
||||
<Compile Include="Sqlite\IcdDbDataReader.cs" />
|
||||
<Compile Include="Sqlite\IcdSqliteCommand.cs" />
|
||||
|
||||
20
ICD.Common.Utils/SPlusUtils.cs
Normal file
20
ICD.Common.Utils/SPlusUtils.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using ICD.Common.Properties;
|
||||
|
||||
namespace ICD.Common.Utils
|
||||
{
|
||||
[PublicAPI("S+")]
|
||||
public static class SPlusUtils
|
||||
{
|
||||
/// <summary>
|
||||
/// Convert two ushort's to an int
|
||||
/// </summary>
|
||||
/// <param name="lowWord">ushort for the least significant 16 bits</param>
|
||||
/// <param name="highWord">ushort for the most significant 1 bits</param>
|
||||
/// <returns></returns>
|
||||
[PublicAPI("S+")]
|
||||
public static int ConvertToInt(ushort lowWord, ushort highWord)
|
||||
{
|
||||
return (highWord << 16) + lowWord;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user