コード例 #1
0
 /// <inheritdoc />
 public void Dispose()
 {
     if (IsInitialized)
     {
         foreach (IRGBDevice device in Devices)
         {
             try
             {
                 CoolerMasterRGBDeviceInfo deviceInfo = (CoolerMasterRGBDeviceInfo)device.DeviceInfo;
                 _CoolerMasterSDK.EnableLedControl(false, deviceInfo.DeviceIndex);
             }
             catch { /* shit happens */ }
         }
     }
 }
コード例 #2
0
 /// <inheritdoc />
 public void ResetDevices()
 {
     if (IsInitialized)
     {
         foreach (IRGBDevice device in Devices)
         {
             try
             {
                 CoolerMasterRGBDeviceInfo deviceInfo = (CoolerMasterRGBDeviceInfo)device.DeviceInfo;
                 _CoolerMasterSDK.SetControlDevice(deviceInfo.DeviceIndex);
                 _CoolerMasterSDK.EnableLedControl(false);
                 _CoolerMasterSDK.EnableLedControl(true);
             }
             catch { /* shit happens */ }
         }
     }
 }
コード例 #3
0
        /// <inheritdoc />
        public void Dispose()
        {
            try { UpdateTrigger?.Dispose(); }
            catch { /* at least we tried */ }

            if (IsInitialized)
            {
                foreach (IRGBDevice device in Devices)
                {
                    try
                    {
                        CoolerMasterRGBDeviceInfo deviceInfo = (CoolerMasterRGBDeviceInfo)device.DeviceInfo;
                        _CoolerMasterSDK.EnableLedControl(false, deviceInfo.DeviceIndex);
                    }
                    catch { /* shit happens */ }
                }
            }

            // DarthAffe 03.03.2020: Should be done but isn't possible due to an weird winodws-hook inside the sdk which corrupts the stack when unloading the dll
            //try { _CoolerMasterSDK.UnloadCMSDK(); }
            //catch { /* at least we tried */ }
        }