Esempio n. 1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="shape">Composite shape to manage.</param>
        public CompositeTransformer(CompositeShape shape) : base(shape)
        {
            if (shape == null)
            {
                throw new ApplicationException();
            }

            _shape = shape;
        }
Esempio n. 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);
            }
        }