Inheritance: IAction, IDisposable
Exemplo n.º 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();
 }
Exemplo n.º 2
0
 public override void Started()
 {
     this.ConstructionComplete = true;
     Transaction = Transaction.Create(Drawing.ActionManager, false);
     ExpectedDependencies = InitExpectedDependencies();
     FoundDependencies.Clear();
 }
Exemplo n.º 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();
        }
Exemplo n.º 4
0
 public void OpenTransaction(Transaction t)
 {
     TransactionStack.Push(t);
 }