Represents a single LED of a CUE-device.
コード例 #1
0
ファイル: CorsairRGBUtil.cs プロジェクト: Aasys/ClockK95
 public static void ColorAll(CorsairLed[] leds, Color color)
 {
     foreach (var corsairLed in leds)
     {
         corsairLed.Color = color;
     }
 }
コード例 #2
0
ファイル: CorsairRGBUtil.cs プロジェクト: Aasys/ClockK95
        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
ファイル: CorsairKey.cs プロジェクト: PeterMortensen/CUE.NET
 internal CorsairKey(CorsairKeyboardKeyId keyId, CorsairLed led, RectangleF keyRectangle)
 {
     this.KeyId = keyId;
     this.Led = led;
     this.KeyRectangle = keyRectangle;
 }
コード例 #6
0
ファイル: ListLedGroup.cs プロジェクト: DarthAffe/CUE.NET
 /// <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;
        }