Skip to content

Commit eecb4e0

Browse files
Cleanup, Removed bHapticsException, bHapticsManager.ConnectionStatus renamed to bHapticsManager.Status, Added Exceptions
1 parent b31c88a commit eecb4e0

File tree

8 files changed

+71
-36
lines changed

8 files changed

+71
-36
lines changed

Properties/GlobalSuppressions.cs

Lines changed: 0 additions & 6 deletions
This file was deleted.

TestApplication/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ private static void Main()
3131

3232
Console.WriteLine();
3333

34-
Console.WriteLine($"Press 0 for {nameof(bHapticsManager.ConnectionStatus)}");
34+
Console.WriteLine($"Press 0 for {nameof(bHapticsManager.Status)}");
3535
Console.WriteLine();
3636

3737
Console.WriteLine($"Press 2 for {nameof(bHapticsManager.GetConnectedDeviceCount)}()");
@@ -106,7 +106,7 @@ static bool KeyCheck()
106106

107107

108108
case ConsoleKey.D0:
109-
Console.WriteLine($"{nameof(bHapticsManager.ConnectionStatus)}: {bHapticsManager.ConnectionStatus}");
109+
Console.WriteLine($"{nameof(bHapticsManager.Status)}: {bHapticsManager.Status}");
110110
goto default;
111111

112112

bHapticsLib/bHapticsConnection.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
namespace bHapticsLib
1212
{
1313
/// <summary>bHaptics Player Connection Handler</summary>
14+
#pragma warning disable IDE1006 // Naming Styles
1415
public class bHapticsConnection : ThreadedTask
16+
#pragma warning restore IDE1006 // Naming Styles
1517
{
1618
#region Type Cache
1719
private static readonly Type intType = typeof(int);

bHapticsLib/bHapticsException.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

bHapticsLib/bHapticsLib.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ Supports .NET Framework 3.5 through .NET 6 and beyond.</Description>
5252
</Compile>
5353
<Compile Include="..\Properties\BuildInfo.cs" Link="Properties\BuildInfo.cs">
5454
</Compile>
55-
<Compile Include="..\Properties\GlobalSuppressions.cs" Link="Properties\GlobalSuppressions.cs">
56-
</Compile>
5755
</ItemGroup>
5856

5957
<ItemGroup>

bHapticsLib/bHapticsLib.xml

Lines changed: 56 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bHapticsLib/bHapticsManager.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
using System.Collections.Generic;
1+
using System;
2+
using System.Collections.Generic;
23

34
namespace bHapticsLib
45
{
56
/// <summary>AIO bHaptics Management</summary>
7+
#pragma warning disable IDE1006 // Naming Styles
68
public static class bHapticsManager
9+
#pragma warning restore IDE1006 // Naming Styles
710
{
811
#region Max Values
912
/// <value>Max Intensity of Point in Integer Array</value>
@@ -20,7 +23,7 @@ public static class bHapticsManager
2023
private static bHapticsConnection Connection = new bHapticsConnection();
2124

2225
/// <value>Current Status of Connection</value>
23-
public static bHapticsStatus ConnectionStatus { get => Connection.Status; }
26+
public static bHapticsStatus Status { get => Connection.Status; }
2427

2528
/// <summary>Connects to the bHaptics Player</summary>
2629
/// <param name="id">Application Identifier</param>
@@ -31,12 +34,12 @@ public static class bHapticsManager
3134
public static bool Connect(string id, string name, bool tryToReconnect = true, int maxRetries = 5)
3235
{
3336
if (string.IsNullOrEmpty(id))
34-
return false; // To-Do: Throw Exception
37+
throw new ArgumentNullException(nameof(id));
3538

3639
if (string.IsNullOrEmpty(name))
37-
return false; // To-Do: Throw Exception
40+
throw new ArgumentNullException(nameof(name));
3841

39-
if (ConnectionStatus != bHapticsStatus.Disconnected)
42+
if (Status != bHapticsStatus.Disconnected)
4043
Disconnect();
4144

4245
Connection.ID = id;
@@ -51,7 +54,7 @@ public static bool Connect(string id, string name, bool tryToReconnect = true, i
5154
/// <returns>true was Successful, otherwise false</returns>
5255
public static bool Disconnect()
5356
{
54-
if (ConnectionStatus == bHapticsStatus.Disconnected)
57+
if (Status == bHapticsStatus.Disconnected)
5558
return true;
5659

5760
StopPlayingAll();

bHapticsLib/bHapticsStatus.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
namespace bHapticsLib
22
{
33
/// <summary>Enum for Connection Status</summary>
4+
#pragma warning disable IDE1006 // Naming Styles
45
public enum bHapticsStatus : int
6+
#pragma warning restore IDE1006 // Naming Styles
57
{
68
/// <summary>Disconnected from the bHaptics Player</summary>
79
Disconnected = 0,

0 commit comments

Comments
 (0)