Example #1
0
        /// <inheritdoc/>
        public override void Deserialize(FRReader reader)
        {
            base.Deserialize(reader);
            points     = new List <PointF>();
            pointTypes = new List <byte>();
            string polyPoints = reader.ReadStr("PolyPoints");

            foreach (string str in polyPoints.Split('|'))
            {
                string[] point = str.Split('\\');
                if (point.Length == 3)
                {
                    float f1 = float.Parse(point[0].Replace(',', '.'), CultureInfo.InvariantCulture);
                    float f2 = float.Parse(point[1].Replace(',', '.'), CultureInfo.InvariantCulture);
                    addPoint(f1, f2, byte.Parse(point[2]));
                }
            }
            if (reader.HasProperty("CenterX"))
            {
                center.X = reader.ReadFloat("CenterX");
            }
            if (reader.HasProperty("CenterY"))
            {
                center.Y = reader.ReadFloat("CenterY");
            }
            //recalculateBounds();
        }
Example #2
0
 /// <inheritdoc/>
 public override void Deserialize(FRReader reader)
 {
     base.Deserialize(reader);
     pointsCollection.Clear();
     if (reader.HasProperty("PolyPoints"))
     {
         string polyPoints = reader.ReadStr("PolyPoints");
         foreach (string str in polyPoints.Split('|'))
         {
             string[] point = str.Split('\\');
             if (point.Length == 3)
             {
                 float f1 = float.Parse(point[0].Replace(',', '.'), CultureInfo.InvariantCulture);
                 float f2 = float.Parse(point[1].Replace(',', '.'), CultureInfo.InvariantCulture);
                 pointsCollection.Add(new PolyPoint(f1, f2));
             }
         }
     }
     else if (reader.HasProperty("PolyPoints_v2"))
     {
         string polyPoints = reader.ReadStr("PolyPoints_v2");
         foreach (string str in polyPoints.Split('|'))
         {
             PolyPoint point = new PolyPoint();
             point.Deserialize(str);
             pointsCollection.Add(point);
         }
     }
     if (reader.HasProperty("CenterX"))
     {
         center.X = reader.ReadFloat("CenterX");
     }
     if (reader.HasProperty("CenterY"))
     {
         center.Y = reader.ReadFloat("CenterY");
     }
     //recalculateBounds();
 }