예제 #1
0
        /// <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);
            }
        }
예제 #2
0
        /// <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);
        }