Switch state change event arguments class.
Inheritance: System.EventArgs
コード例 #1
0
 /// <summary>
 /// Raises the switch state changed event.
 /// </summary>
 /// <param name="e">
 /// The event arguments.
 /// </param>
 protected virtual void OnSwitchStateChanged(SwitchStateChangeEventArgs e)
 {
     if (this.StateChanged != null)
     {
         this.StateChanged(this, e);
     }
 }
コード例 #2
0
        /// <summary>
        /// Raises the state changed event.
        /// </summary>
        /// <param name="sender">
        /// The object firing the event.
        /// </param>
        /// <param name="e">
        /// The event arguments.
        /// </param>
        private void OnStateChanged(Object sender, PinStateChangeEventArgs e)
        {
            if (e.NewState != e.OldState)
            {
                SwitchStateChangeEventArgs changeArgs = null;
                if (e.NewState == ON_STATE)
                {
                    changeArgs = new SwitchStateChangeEventArgs(SwitchState.Off, SwitchState.On);
                }
                else
                {
                    changeArgs = new SwitchStateChangeEventArgs(SwitchState.On, SwitchState.Off);
                }

                base.OnSwitchStateChanged(changeArgs);
            }
        }
コード例 #3
0
		/// <summary>
		/// Raises the state changed event.
		/// </summary>
		/// <param name="sender">
		/// The object firing the event.
		/// </param>
		/// <param name="e">
		/// The event arguments.
		/// </param>
		private void OnStateChanged(Object sender, PinStateChangeEventArgs e) {
			if (e.NewState != e.OldState) {
				SwitchStateChangeEventArgs changeArgs = null;
				if (e.NewState == ON_STATE) {
					changeArgs = new SwitchStateChangeEventArgs(SwitchState.Off, SwitchState.On);
				}
				else {
					changeArgs = new SwitchStateChangeEventArgs(SwitchState.On, SwitchState.Off);
				}

				base.OnSwitchStateChanged(changeArgs);
			}
		}
コード例 #4
0
ファイル: OpenerDevice.cs プロジェクト: cyrusbuilt/MonoPi
		/// <summary>
		/// Handles the lock state changed.
		/// </summary>
		/// <param name="sender">
		/// The object firing the event. Should be a reference to
		/// the switch instance that triggered the event.
		/// </param>
		/// <param name="e">
		/// The event arguments.
		/// </param>
		private void OnLockStateChanged(Object sender, SwitchStateChangeEventArgs e) {
			base.OnLockChanged(new OpenerLockChangeEventArgs(((ISwitch)sender).IsOn));
		}
コード例 #5
0
ファイル: SwitchBase.cs プロジェクト: cyrusbuilt/MonoPi
		/// <summary>
		/// Raises the switch state changed event.
		/// </summary>
		/// <param name="e">
		/// The event arguments.
		/// </param>
		protected virtual void OnSwitchStateChanged(SwitchStateChangeEventArgs e) {
			if (this.StateChanged != null) {
				this.StateChanged(this, e);
			}
		}