public static void ColorAll(CorsairLed[] leds, Color color) { foreach (var corsairLed in leds) { corsairLed.Color = color; } }
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; }
/// <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); }
/// <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) { }
internal CorsairKey(CorsairKeyboardKeyId keyId, CorsairLed led, RectangleF keyRectangle) { this.KeyId = keyId; this.Led = led; this.KeyRectangle = keyRectangle; }
/// <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); }
/// <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; }