Represents a single LED of a CUE-device.
示例#1
0
 public static void ColorAll(CorsairLed[] leds, Color color)
 {
     foreach (var corsairLed in leds)
     {
         corsairLed.Color = color;
     }
 }
示例#2
0
        public static CorsairLed[] GetGKeys(Dictionary<string, CorsairLed> ledMap)
        {
            var maxG = 18;
            var gLeds = new CorsairLed[18];

            for (var i = 1; i <= 18 ; i++)
            {
                gLeds[i-1] = ledMap["G" + i];
            }
            return gLeds;
        }
示例#3
0
        /// <summary>
        /// Initializes the LED-Object with the specified id.
        /// </summary>
        /// <param name="ledId">The LED-Id to initialize.</param>
        /// <param name="ledRectangle">The rectangle representing the position of the LED to initialize.</param>
        /// <returns></returns>
        protected CorsairLed InitializeLed(CorsairLedId ledId, RectangleF ledRectangle)
        {
            if (LedMapping.ContainsKey(ledId))
            {
                return(null);
            }

            CorsairLed led = new CorsairLed(this, ledId, ledRectangle);

            LedMapping.Add(ledId, led);
            return(led);
        }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RectangleLedGroup"/> class.
 /// </summary>
 /// <param name="device">The device this ledgroup belongs to.</param>
 /// <param name="fromLed">They first LED to calculate the rectangle of this ledgroup from.</param>
 /// <param name="toLed">They second LED to calculate the rectangle of this ledgroup from.</param>
 /// <param name="minOverlayPercentage">(optional) The minimal percentage overlay a LED must have with the <see cref="Rectangle" /> to be taken into the ledgroup. (default: 0.5f)</param>
 /// <param name="autoAttach">(optional) Specifies whether this group should be automatically attached or not. (default: true)</param>
 public RectangleLedGroup(ICueDevice device, CorsairLed fromLed, CorsairLed toLed, float minOverlayPercentage = 0.5f, bool autoAttach = true)
     : this(device, RectangleHelper.CreateRectangleFromRectangles(fromLed.LedRectangle, toLed.LedRectangle), minOverlayPercentage, autoAttach)
 { }
示例#5
0
 internal CorsairKey(CorsairKeyboardKeyId keyId, CorsairLed led, RectangleF keyRectangle)
 {
     this.KeyId = keyId;
     this.Led = led;
     this.KeyRectangle = keyRectangle;
 }
示例#6
0
 /// <summary>
 /// Checks if a given LED is contained by this ledgroup.
 /// </summary>
 /// <param name="led">The LED which should be checked.</param>
 /// <returns><c>true</c> if the LED is contained by this ledgroup; otherwise, <c>false</c>.</returns>
 public bool ContainsLed(CorsairLed led)
 {
     return led != null && GroupLeds.Contains(led);
 }
示例#7
0
        /// <summary>
        /// Initializes the LED-Object with the specified id.
        /// </summary>
        /// <param name="ledId">The LED-Id to initialize.</param>
        /// <param name="ledRectangle">The rectangle representing the position of the LED to initialize.</param>
        /// <returns></returns>
        protected CorsairLed InitializeLed(CorsairLedId ledId, RectangleF ledRectangle)
        {
            if (LedMapping.ContainsKey(ledId)) return null;

            CorsairLed led = new CorsairLed(ledId, ledRectangle);
            LedMapping.Add(ledId, led);
            return led;
        }