Ejemplo n.º 1
0
 /// <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;
 }
Ejemplo n.º 2
0
        /// <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);
        }