Exemplo n.º 1
0
        /// <summary>
        /// Value clone
        /// </summary>
        /// <returns>new polyline shape</returns>
        public new PolylineShape ValueClone()
        {
            CurveLineShape aPLS = new CurveLineShape();

            aPLS.value    = value;
            aPLS.Visible  = Visible;
            aPLS.Selected = Selected;

            return(aPLS);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Clone polylineshape
        /// </summary>
        /// <returns>PolylineShape</returns>
        public override object Clone()
        {
            CurveLineShape aPLS = new CurveLineShape();

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

            return(aPLS);
        }
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);
        }