Exemple #1
0
        /// <summary>
        /// Called when a shape is removed.
        /// </summary>
        /// <param name="shape">Removed shape.</param>
        /// <param name="index">Removing index.</param>
        void _shapes_RemovedItem(IShape shape, int index)
        {
            (shape as Shape).Parent = null;

            Geometric.Reset();

            foreach (IShape grouppedShape in _shapes)
            {
                Geometric.AddPath(grouppedShape.Geometric, false);
            }
        }
Exemple #2
0
        /// <summary>
        /// Mouse down function.
        /// </summary>
        /// <param name="document">Informations transferred from DrawingPanel.</param>
        /// <param name="e">MouseEventArgs.</param>
        public override void MouseDown(IDocument document, System.Windows.Forms.MouseEventArgs e)
        {
            _shape = _memoryShape.Clone() as IShape;

            Geometric.Reset();
            Geometric.AddPath(_shape.Geometric, false);

            Visible  = false;
            Selected = false;

            InitializeVersors(_shape.HitTest(e.Location));

            base.MouseDown(document, e);
        }
Exemple #3
0
        /// <summary>
        /// Copy constructor.
        /// </summary>
        /// <param name="ghost">Shape to copy.</param>
        public Ghost(Ghost ghost) : base(ghost)
        {
            _referenceShape = ghost.Shape;
            _memoryShape    = ghost.Shape.Clone() as IShape;
            _shape          = _memoryShape.Clone() as IShape;

            Geometric.Reset();
            Geometric.AddPath(ghost.Shape.Geometric, false);

            ghost.Selected = false;
            ghost.Visible  = false;

            this.Transformer.MirrorHorizontalOccurred += new MirrorHorizontalHandler(Transformer_MirrorHorizontalOccurred);
            this.Transformer.MirrorVerticalOccurred   += new MirrorVerticalHandler(Transformer_MirrorVerticalOccurred);

            this.Appearance = new GhostAppearance();
        }
Exemple #4
0
        /// <summary>
        /// Called when a shape is inserted.
        /// </summary>
        /// <param name="shape">Inserted shape.</param>
        /// <param name="index">Inserting index.</param>
        void _shapes_InsertedItem(IShape shape, int index)
        {
            (shape as Shape).Parent = this;

            Geometric.AddPath(shape.Geometric, false);
        }