Example #1
0
 protected virtual void OnUndo(RuleStateEventArgs e)
 {
     if (e != null)
     {
         e.State = RuleStateEventArgs.OnState.Undo;
     }
     WasUndo?.Invoke(this, e);
 }
Example #2
0
 protected virtual void OnRedo(RuleStateEventArgs e)
 {
     if (e != null)
     {
         e.State = RuleStateEventArgs.OnState.Redo;
     }
     FinishCheck(e);
     OnNewState(e);
     WasRedo?.Invoke(this, e);
 }
Example #3
0
        private void FinishCheck(RuleStateEventArgs e)
        {
            var addedState = e?.StateObject;

            if (addedState == null)
            {
                worker.CancelAsync();
            }
            if (addedState is FinishedState)
            {
                worker.CancelAsync();
                Finished?.Invoke(this, new RuleStateEventArgs(addedState)
                {
                    State = RuleStateEventArgs.OnState.NewState | RuleStateEventArgs.OnState.Finished
                });
            }
        }
Example #4
0
 protected virtual void OnNewState(RuleStateEventArgs e)
 {
     FinishCheck(e);
     NewState?.Invoke(this, e);
 }