1
0
mirror of https://github.com/DarthAffe/CUE.NET.git synced 2025-12-12 16:58:29 +00:00

Fixed some exception related stuff in the CUE.NET initialization

This commit is contained in:
Darth Affe 2015-11-13 11:05:34 +01:00
parent e813f32cdc
commit 20b28087f6

View File

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