Exemple #1
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public CompositeShape()
        {
            Transformer = new CompositeTransformer(this);

            _shapes.InsertedItem += new ShapeCollection.OnInsertedItem(_shapes_InsertedItem);
            _shapes.RemovedItem  += new ShapeCollection.OnRemovedItem(_shapes_RemovedItem);
        }
Exemple #2
0
        /// <summary>
        /// Copy constructor.
        /// </summary>
        /// <param name="compositeShape">CompositeShape to copy.</param>
        public CompositeShape(CompositeShape compositeShape) : base(compositeShape)
        {
            Transformer = new CompositeTransformer(this);

            _shapes.InsertedItem += new ShapeCollection.OnInsertedItem(_shapes_InsertedItem);
            _shapes.RemovedItem  += new ShapeCollection.OnRemovedItem(_shapes_RemovedItem);

            Geometric.Reset();

            foreach (IShape shape in compositeShape.Shapes)
            {
                _shapes.Add(shape.Clone() as IShape);
            }
        }