/// <summary> /// Raises the state changed event. /// </summary> /// <param name="e"> /// The event arguments. /// </param> protected virtual void OnStateChanged(FireplaceStateChangedEventArgs e) { if (this.StateChanged != null) { this.StateChanged(this, e); } }
/// <summary> /// Internal event handler for the relay state changed event. /// This fires the fireplace state changed event when the /// relay's state changes. /// </summary> /// <param name="sender"> /// The object raising the event (a reference to the relay object). /// </param> /// <param name="e"> /// The event arguments. /// </param> private void InternalHandleRelayStateChange(Object sender, RelayStateChangedEventArgs e) { FireplaceStateChangedEventArgs stateChangeEvent = null; if (e.NewState == this._fireplaceOnRelayState) { stateChangeEvent = new FireplaceStateChangedEventArgs(FireplaceState.Off, FireplaceState.On); } else { stateChangeEvent = new FireplaceStateChangedEventArgs(FireplaceState.On, FireplaceState.Off); } base.OnStateChanged(stateChangeEvent); }
/// <summary> /// Internal event handler for the relay state changed event. /// This fires the fireplace state changed event when the /// relay's state changes. /// </summary> /// <param name="sender"> /// The object raising the event (a reference to the relay object). /// </param> /// <param name="e"> /// The event arguments. /// </param> private void InternalHandleRelayStateChange(Object sender, RelayStateChangedEventArgs e) { FireplaceStateChangedEventArgs stateChangeEvent = null; if (e.NewState == this._fireplaceOnRelayState) { stateChangeEvent = new FireplaceStateChangedEventArgs(FireplaceState.Off, FireplaceState.On); } else { stateChangeEvent = new FireplaceStateChangedEventArgs(FireplaceState.On, FireplaceState.Off); } base.OnStateChanged(stateChangeEvent); }
/// <summary> /// An internal handler for the state change event. /// </summary> /// <param name="sender"> /// The object raising the event (ourself). /// </param> /// <param name="e"> /// The event arguments. /// </param> private void InternalStateChangeHandler(Object sender, FireplaceStateChangedEventArgs e) { this.CancelTimeoutTask(); }
/// <summary> /// An internal handler for the state change event. /// </summary> /// <param name="sender"> /// The object raising the event (ourself). /// </param> /// <param name="e"> /// The event arguments. /// </param> private void InternalStateChangeHandler(Object sender, FireplaceStateChangedEventArgs e) { this.CancelTimeoutTask(); }
/// <summary> /// Raises the state changed event. /// </summary> /// <param name="e"> /// The event arguments. /// </param> protected virtual void OnStateChanged(FireplaceStateChangedEventArgs e) { if (this.StateChanged != null) { this.StateChanged(this, e); } }