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(); }
public override void Started() { this.ConstructionComplete = true; Transaction = Transaction.Create(Drawing.ActionManager, false); ExpectedDependencies = InitExpectedDependencies(); FoundDependencies.Clear(); }
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(); }
public void OpenTransaction(Transaction t) { TransactionStack.Push(t); }