feat: Adding SPlusUtils to convert ushort's to int

This commit is contained in:
Drew Tingen
2019-04-09 15:46:10 -04:00
parent 30ea6ced9e
commit 829c24b667
2 changed files with 21 additions and 0 deletions

View File

@@ -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" />

View 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;
}
}
}