Exemple #1
0
 protected virtual void OnStateChanging(IState state)
 {
     if (StateChanging != null)
     {
         StateChanging.Invoke(this, new StateEventArgs(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);
 }
Exemple #3
0
        private void SetIsStateChanging(bool isStartedStateChange)
        {
            if (IsStateChanging == isStartedStateChange)
            {
                return;
            }

            IsStateChanging = isStartedStateChange;
            if (isStartedStateChange)
            {
                StateChanging?.Invoke();
            }
            else
            {
                StateChanged?.Invoke();
            }
        }
Exemple #4
0
 /// <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);
 }
Exemple #5
0
 //---------------------------------------------------------------------
 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));
 }
Exemple #7
0
 private void _stateMachineOnStateChanging(object sender, StateEventArgs <ConnectorState> e)
 {
     StateChanging?.Invoke(this, e);
 }
Exemple #8
0
 protected virtual void OnStateChanging(object sender, PortState e)
 {
     StateChanging?.Invoke(sender, e);
 }
Exemple #9
0
 protected virtual void EndedPrint() => StateChanging?.Invoke(this, new PrinterEventArgs(this, "Ended"));