/// <summary> /// Handles the sensor state changed event. /// </summary> /// <param name="sender"> /// The object firing the event. Should be a reference to /// the sensor insance that triggered the event. /// </param> /// <param name="e"> /// The event arguments. /// </param> private void OnSensorStateChanged(Object sender, SensorStateChangedEventArgs e) { OpenerState oldState = this.GetOpenerState(e.OldState); OpenerState newState = this.GetOpenerState(e.NewState); base.OnStateChanged(new OpenerStateChangeEventArgs(oldState, newState)); }
/// <summary> /// Internal handler for the pilot light sensor state changed event. /// This fires pilot light state changed event when the pilot light's /// state changes. /// </summary> /// <param name="sender"> /// The object raising the event (a reference to the sensor object). /// </param> /// <param name="e"> /// The event arguments. /// </param> private void InternalHandleSensorStateChange(Object sender, SensorStateChangedEventArgs e) { if (e.NewState != this._pilotLightOnSensorState) { this.Off(); } base.OnPilotLightStateChanged(new FireplacePilotLightEventArgs(this.IsPilotLightOn)); }