Inheritance: IAction, IDisposable
Beispiel #1
0
 protected virtual void AddFiguresAndRestart()
 {
     RemoveTempResultsIfNecessary();
     var figures = CreateFigures().ToList();
     foreach (var figure in figures)
     {
         if (figure != null)
         {
             Actions.Add(Drawing, figure);
         }
     }
     Drawing.RaiseUserIsAddingFigures(new Drawing.UIAFEventArgs() { Figures = figures });
     Transaction.Commit();
     Transaction = null;
     this.ConstructionComplete = true;
     Drawing.RaiseConstructionStepComplete(new Drawing.ConstructionStepCompleteEventArgs()
     {
         ConstructionComplete = true
     });
     Restart();
 }
Beispiel #2
0
 public override void Started()
 {
     this.ConstructionComplete = true;
     Transaction = Transaction.Create(Drawing.ActionManager, false);
     ExpectedDependencies = InitExpectedDependencies();
     FoundDependencies.Clear();
 }
Beispiel #3
0
        public override void Stopping()
        {
            if (Transaction != null)
            {
                if (this.ConstructionComplete)
                {
                    Transaction.Dispose();  // Changes in Property Grid
                }
                else
                {
                    Transaction.Rollback(); // Incomplete constructions
                }
                Transaction = null;
            }

            // Raise this is necessary to enable/disable undo/redo properly. - D.H.
            Drawing.RaiseConstructionStepComplete(new Drawing.ConstructionStepCompleteEventArgs()
            {
                ConstructionComplete = true
            });

            Drawing.Figures.EnableAll();

            RemoveTempPointIfNecessary();
            RemoveTempResultsIfNecessary();
            RemoveIntermediateFigureIfNecessary();
        }
Beispiel #4
0
 public void OpenTransaction(Transaction t)
 {
     TransactionStack.Push(t);
 }