protected override void GhostDrawingComplete() { try { SimpleEllipse shape = new SimpleEllipse(this.Controller.Model); shape.Width = (int) Rectangle.Width; shape.Height = (int) Rectangle.Height; AddShapeCommand cmd = new AddShapeCommand(this.Controller, shape, new Point((int) Rectangle.X, (int)Rectangle.Y)); this.Controller.UndoManager.AddUndoCommand(cmd); cmd.Redo(); } catch { base.Controller.DeactivateTool(this); Controller.View.Invalidate(); throw; } base.Controller.DeactivateTool(this); }
protected override void GhostDrawingComplete() { try { SimpleEllipse shape = new SimpleEllipse(this.Controller.Model); shape.Width = (int)Rectangle.Width; shape.Height = (int)Rectangle.Height; AddShapeCommand cmd = new AddShapeCommand(this.Controller, shape, new Point((int)Rectangle.X, (int)Rectangle.Y)); this.Controller.UndoManager.AddUndoCommand(cmd); cmd.Redo(); } catch { base.Controller.DeactivateTool(this); Controller.View.Invalidate(); throw; } base.Controller.DeactivateTool(this); }