Пример #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;
 }
Пример #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);
        }