/// <summary> /// Initializes a new instance of the <see cref="CorsairDeviceProvider"/> class. /// </summary> /// <exception cref="InvalidOperationException">Thrown if this constructor is called even if there is already an instance of this class.</exception> public CorsairDeviceProvider() { if (_instance != null) { throw new InvalidOperationException($"There can be only one instanc of type {nameof(CorsairDeviceProvider)}"); } _instance = this; }
/// <summary> /// Initializes a new instance of the <see cref="CorsairDeviceProvider"/> class. /// </summary> /// <exception cref="InvalidOperationException">Thrown if this constructor is called even if there is already an instance of this class.</exception> public CorsairDeviceProvider() { if (_instance != null) { throw new InvalidOperationException($"There can be only one instance of type {nameof(CorsairDeviceProvider)}"); } _instance = this; UpdateTrigger = new DeviceUpdateTrigger(); _updateQueue = new CorsairUpdateQueue(UpdateTrigger); }