mirror of
https://github.com/DarthAffe/CUE.NET.git
synced 2026-11-11 21:16:24 +00:00
Fixed some exception related stuff in the CUE.NET initialization
This commit is contained in:
1 parent
e813f32cdc
commit
20b28087f6
1 file changed
+3
-1
@@ -61,11 +61,13 @@ namespace CUE.NET
|
|||||||
|
|
||||||
#region Methods
|
#region Methods
|
||||||
|
|
||||||
|
// ReSharper disable once ExceptionNotThrown
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes the CUE-SDK. This method should be called exactly ONE time, before anything else is done.
|
/// Initializes the CUE-SDK. This method should be called exactly ONE time, before anything else is done.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="exclusiveAccess">Specifies whether the application should request exclusive access or not.</param>
|
/// <param name="exclusiveAccess">Specifies whether the application should request exclusive access or not.</param>
|
||||||
/// <exception cref="WrapperException">Thrown if the SDK is already initialized, the SDK is not compatible to CUE or if CUE returns unknown devices.</exception>
|
/// <exception cref="WrapperException">Thrown if the SDK is already initialized, the SDK is not compatible to CUE or if CUE returns unknown devices.</exception>
|
||||||
|
/// <exception cref="CUEException">Thrown if the CUE-SDK provides an error.</exception>
|
||||||
public static void Initialize(bool exclusiveAccess = false)
|
public static void Initialize(bool exclusiveAccess = false)
|
||||||
{
|
{
|
||||||
if (ProtocolDetails != null)
|
if (ProtocolDetails != null)
|
||||||
@@ -85,7 +87,7 @@ namespace CUE.NET
|
|||||||
if (exclusiveAccess)
|
if (exclusiveAccess)
|
||||||
{
|
{
|
||||||
if (!_CUESDK.CorsairRequestControl(CorsairAccessMode.ExclusiveLightingControl))
|
if (!_CUESDK.CorsairRequestControl(CorsairAccessMode.ExclusiveLightingControl))
|
||||||
Throw(error);
|
Throw(LastError);
|
||||||
|
|
||||||
HasExclusiveAccess = true;
|
HasExclusiveAccess = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user