Exemplo n.º 1
0
        public CustomShape EditShape(CustomShape shape)
        {
            if (shape == null)
            {
                return(null);
            }

            CustomShape newShape = shape.Clone();

            shapeEditorControl1.Reset();

            if (!newShape.DoFixDimension())
            {
                newShape.CreateRectangleShape(0, 0, 200, 120);
            }

            shapeEditorControl1.Shape     = newShape.Shape;
            shapeEditorControl1.Dimension = newShape.Dimension;

            if ((result = this.ShowDialog()) == DialogResult.OK)
            {
                newShape.Dimension = shapeEditorControl1.Dimension;
                return(newShape);
            }
            else
            {
                return(shape);
            }
        }
Exemplo n.º 2
0
        public CustomShape EditShape(CustomShape shape)
        {
            if (shape == null)
            {
                return((CustomShape)null);
            }
            CustomShape customShape = shape.Clone();

            this.shapeEditorControl1.Reset();
            if (!customShape.DoFixDimension())
            {
                customShape.CreateRectangleShape(0.0f, 0.0f, 200f, 120f);
            }
            this.shapeEditorControl1.Shape     = customShape.Shape;
            this.shapeEditorControl1.Dimension = customShape.Dimension;
            if ((this.result = this.ShowDialog()) != DialogResult.OK)
            {
                return(shape);
            }
            customShape.Dimension = this.shapeEditorControl1.Dimension;
            return(customShape);
        }