Merge branch 'feat/SPlusUtils' of Common/Utils into dev

This commit is contained in:
Chris Cameron 2019-04-09 19:58:33 +00:00 committed by Gogs
commit 798e9cc0a7
3 changed files with 26 additions and 0 deletions

View file

@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- Added SPlusUtils with ConvertToInt method taking LowWord/HighWord ushorts
## [9.2.0] - 2019-03-01
### Added

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,23 @@
using ICD.Common.Properties;
namespace ICD.Common.Utils
{
/// <summary>
/// Static class containing useful utilities for use in S+ programs
/// </summary>
[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;
}
}
}