/// <summary> /// Invokes LedChanged event. /// </summary> /// <param name="e">Arguments passed with event.</param> protected virtual void OnLedChanged(LedEventArgs e) { LedChanged?.Invoke(this, e); }
/// <summary> /// Starts observing LED's brightness for changes. /// </summary> /// <remarks> /// Event LedChanged will be never invoked before calling this method. /// </remarks> public void StartListening() { Led.BrightnessChanged += (s, e) => { LedChanged?.Invoke(s, new LedEventArgs(e.Brightness)); }; }