mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +00:00
feat: Adding SPlusUtils to convert ushort's to int
This commit is contained in:
parent
30ea6ced9e
commit
829c24b667
2 changed files with 21 additions and 0 deletions
|
|
@ -186,6 +186,7 @@
|
||||||
<Compile Include="SafeCriticalSection.SimplSharp.cs" />
|
<Compile Include="SafeCriticalSection.SimplSharp.cs" />
|
||||||
<Compile Include="SafeCriticalSection.Standard.cs" />
|
<Compile Include="SafeCriticalSection.Standard.cs" />
|
||||||
<Compile Include="SafeMutex.cs" />
|
<Compile Include="SafeMutex.cs" />
|
||||||
|
<Compile Include="SPlusUtils.cs" />
|
||||||
<Compile Include="Sqlite\eDbType.cs" />
|
<Compile Include="Sqlite\eDbType.cs" />
|
||||||
<Compile Include="Sqlite\IcdDbDataReader.cs" />
|
<Compile Include="Sqlite\IcdDbDataReader.cs" />
|
||||||
<Compile Include="Sqlite\IcdSqliteCommand.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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue