protected virtual void OnStateChanging(IState state) { if (StateChanging != null) { StateChanging.Invoke(this, new StateEventArgs(state)); } }
public void TransitionTo(TimeState state) { StateChanging.Invoke(this, new TimeChangedEventArgs(LeftTime, state)); State = state; State.SetContext(this); StateChanged.Invoke(this, new TimeChangedEventArgs(LeftTime, state)); }
protected override void OnStateChanged(TaskState oldValue, TaskState newValue) { TaskDebug.Verbose($"TA: Task[{Label}] State Changing: {oldValue} -> {newValue}"); StateChanging?.Invoke(this, new PropertyUpdateEventArgs <TaskState>(nameof(ITask.State), oldValue, newValue)); TaskDebug.Verbose($"TA: Task[{Label}] State Changed: {oldValue} -> {newValue}"); base.OnStateChanged(oldValue, newValue); }
/// <summary> /// Switches the state. /// </summary> /// <param name="nextState">Then next state.</param> protected virtual void SwitchState(State nextState) { StateChanging?.Invoke(); currentState?.OnExit(nextState); currentState = nextState; currentState?.OnEnter(); StateChanged?.Invoke(); }
private void SetIsStateChanging(bool isStartedStateChange) { if (IsStateChanging == isStartedStateChange) { return; } IsStateChanging = isStartedStateChange; if (isStartedStateChange) { StateChanging?.Invoke(); } else { StateChanged?.Invoke(); } }
/// <summary> /// Abandon all the operations of the transaction instead of saving them. /// All cursors opened within the transaction will be closed by this call. /// The cursors and transaction handle will be freed and must not be used again after this call. /// </summary> public void Abort() { State = LightningTransactionState.Aborted; StateChanging?.Invoke(State); Lmdb.mdb_txn_abort(_handle); }
/// <summary> /// Commit all the operations of a transaction into the database. /// All cursors opened within the transaction will be closed by this call. /// The cursors and transaction handle will be freed and must not be used again after this call. /// </summary> public void Commit() { State = LightningTransactionState.Commited; StateChanging?.Invoke(State); Lmdb.mdb_txn_commit(_handle); }
/// <summary> /// Raises the <see cref="E:StateChanging" /> event. /// </summary> /// <param name="e">The <see cref="StateChangingEventArgs{TState}" /> instance containing the event data.</param> protected void OnStateChanging(StateChangingEventArgs <TState> e) { StateChanging?.Invoke(this, e); }
//--------------------------------------------------------------------- private void _onStateChanging(T oldState, T newState) { StateChanging?.Invoke(this, new StateEventArgs <T>(oldState, newState)); }
/// <summary> /// Commit all the operations of a transaction into the database. /// All cursors opened within the transaction will be closed by this call. /// The cursors and transaction handle will be freed and must not be used again after this call. /// </summary> public MDBResultCode Commit() { State = LightningTransactionState.Commited; StateChanging?.Invoke(State); return(mdb_txn_commit(_handle)); }
private void _stateMachineOnStateChanging(object sender, StateEventArgs <ConnectorState> e) { StateChanging?.Invoke(this, e); }
protected virtual void OnStateChanging(object sender, PortState e) { StateChanging?.Invoke(sender, e); }
protected virtual void EndedPrint() => StateChanging?.Invoke(this, new PrinterEventArgs(this, "Ended"));