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 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(); }
protected void AdvertiseNextDependency() { var nextDependency = GetExpectedDependencyType(); this.ConstructionComplete = false; Drawing.RaiseConstructionStepComplete(new Drawing.ConstructionStepCompleteEventArgs() { ConstructionComplete = false, FigureTypeNeeded = nextDependency }); }