/// <summary>
        /// Clone CurvePolygonShape with values
        /// </summary>
        /// <returns>new curve polygon shape</returns>
        public new CurvePolygonShape ValueClone()
        {
            CurvePolygonShape aPGS = new CurvePolygonShape();

            aPGS.highValue = highValue;
            aPGS.lowValue  = lowValue;
            aPGS.Visible   = Visible;
            aPGS.Selected  = Selected;

            return(aPGS);
        }
        /// <summary>
        /// Clone CurvePolygonShape
        /// </summary>
        /// <returns>CurvePolygonShape</returns>
        public override object Clone()
        {
            CurvePolygonShape aPGS = new CurvePolygonShape();

            aPGS.Extent    = Extent;
            aPGS.highValue = highValue;
            aPGS.lowValue  = lowValue;
            aPGS.PartNum   = PartNum;
            aPGS.parts     = (int[])parts.Clone();
            aPGS.Points    = new List <PointD>(Points);
            aPGS.Visible   = Visible;
            aPGS.Selected  = Selected;

            return(aPGS);
        }
Exemplo n.º 3
0
        private Shape LoadShape(XmlNode shapeNode)
        {
            Shape aShape = new Shape();

            try
            {
                ShapeTypes shapeType = (ShapeTypes)Enum.Parse(typeof(ShapeTypes), shapeNode.Attributes["ShapeType"].InnerText, true);
                switch (shapeType)
                {
                case ShapeTypes.Point:
                    aShape = new PointShape();
                    break;

                case ShapeTypes.WindArraw:
                    aShape = new WindArraw();
                    break;

                case ShapeTypes.Polyline:
                    aShape = new PolylineShape();
                    break;

                case ShapeTypes.CurveLine:
                    aShape = new CurveLineShape();
                    break;

                case ShapeTypes.Circle:
                    aShape = new CircleShape();
                    break;

                case ShapeTypes.Polygon:
                case ShapeTypes.Rectangle:
                    aShape = new PolygonShape();
                    break;

                case ShapeTypes.CurvePolygon:
                    aShape = new CurvePolygonShape();
                    break;

                case ShapeTypes.Ellipse:
                    aShape = new EllipseShape();
                    break;
                }

                aShape.Visible  = bool.Parse(shapeNode.Attributes["Visible"].InnerText);
                aShape.Selected = bool.Parse(shapeNode.Attributes["Selected"].InnerText);

                List <PointD> pointList  = new List <PointD>();
                XmlNode       pointsNode = shapeNode.ChildNodes[0];
                foreach (XmlNode pNode in pointsNode.ChildNodes)
                {
                    PointD aPoint = new PointD(double.Parse(pNode.Attributes["X"].InnerText),
                                               double.Parse(pNode.Attributes["Y"].InnerText));
                    pointList.Add(aPoint);
                }
                aShape.SetPoints(pointList);
            }
            catch
            {
            }

            return(aShape);
        }