Example #1
0
        /// <summary>
        /// Creates a new shape from this template.
        /// </summary>
        /// <returns></returns>
        public Shape CreateShape()
        {
            Shape result = shape.Type.CreateInstance(this);

            if (shape.ModelObject != null)
            {
                ShapeDuplicator.CloneModelObjectOnly(result);
            }
            return(result);
        }
Example #2
0
        /// <summary>
        /// Creates a new shape from this template.
        /// </summary>
        public TShape CreateShape <TShape>() where TShape : Shape
        {
            TShape result = (TShape)_shape.Type.CreateInstance(this);

            if (_shape.ModelObject != null)
            {
                ShapeDuplicator.CloneModelObjectOnly(result);
            }
            return(result);
        }