예제 #1
0
        protected override void GhostDrawingComplete()
        {
            try
            {
                TextOnly shape = new TextOnly(this.Controller.Model);
                shape.Width = (int) Rectangle.Width;
                shape.Height = (int) Rectangle.Height;
                shape.Text = "New label";
                shape.ShapeColor = Color.WhiteSmoke;
                AddShapeCommand cmd = new AddShapeCommand(this.Controller, shape, new Point((int) Rectangle.X, (int)Rectangle.Y));
                this.Controller.UndoManager.AddUndoCommand(cmd);
                cmd.Redo();
                TextEditor.GetEditor(shape);
                TextEditor.Show();
            }
            catch
            {
                base.Controller.DeactivateTool(this);
                Controller.View.Invalidate();
                throw;
            }

            base.Controller.DeactivateTool(this);
        }
예제 #2
0
        protected override void GhostDrawingComplete()
        {
            try
            {
                TextOnly shape = new TextOnly(this.Controller.Model);
                shape.Width      = (int)Rectangle.Width;
                shape.Height     = (int)Rectangle.Height;
                shape.Text       = "New label";
                shape.ShapeColor = Color.WhiteSmoke;
                AddShapeCommand cmd = new AddShapeCommand(this.Controller, shape, new Point((int)Rectangle.X, (int)Rectangle.Y));
                this.Controller.UndoManager.AddUndoCommand(cmd);
                cmd.Redo();
                TextEditor.GetEditor(shape);
                TextEditor.Show();
            }
            catch
            {
                base.Controller.DeactivateTool(this);
                Controller.View.Invalidate();
                throw;
            }

            base.Controller.DeactivateTool(this);
        }