/// <inheritdoc /> protected override void UpdateLeds(IEnumerable <Led> ledsToUpdate) { List <Led> leds = ledsToUpdate.Where(x => x.Color.A > 0).ToList(); if (leds.Count > 0) { _CoolerMasterSDK.SetControlDevice(DeviceInfo.DeviceIndex); foreach (Led led in leds) { CoolerMasterLedId ledId = (CoolerMasterLedId)led.Id; _CoolerMasterSDK.SetLedColor(ledId.Row, ledId.Column, led.Color.R, led.Color.G, led.Color.B); } _CoolerMasterSDK.RefreshLed(false); } }
/// <summary> /// Tests whether the specified object is a <see cref="CoolerMasterLedId" /> and is equivalent to this <see cref="CoolerMasterLedId" />. /// </summary> /// <param name="obj">The object to test.</param> /// <returns><c>true</c> if <paramref name="obj" /> is a <see cref="CoolerMasterLedId" /> equivalent to this <see cref="CoolerMasterLedId" />; otherwise, <c>false</c>.</returns> public override bool Equals(object obj) { CoolerMasterLedId compareLedId = obj as CoolerMasterLedId; if (ReferenceEquals(compareLedId, null)) { return(false); } if (ReferenceEquals(this, compareLedId)) { return(true); } if (GetType() != compareLedId.GetType()) { return(false); } return(compareLedId.LedId == LedId); }