Пример #1
0
 private void LoadMap(string path)
 {
     if (File.Exists(path))
     {
         using (StreamReader sr = File.OpenText(path))
         {
             RealVisualMap1.ClearPlot();
             XmlSerializer xmlSerializer = new XmlSerializer(typeof(PlaceXmlModel));
             var           place         = xmlSerializer.Deserialize(sr) as PlaceXmlModel;
             RealVisualMap1.DrawMap(place);
         }
     }
 }
Пример #2
0
 private void LoadPoint(string path)
 {
     if (File.Exists(path))
     {
         originPoints.Clear();
         RealVisualMap1.ClearPlot();
         using (StreamReader sr = new StreamReader(path))
         {
             string str;
             while ((str = sr.ReadLine()) != null)
             {
                 string   coordinateStr  = str.Split(' ')[2];
                 string[] coordinateStrs = coordinateStr.Split(',');
                 string   x = coordinateStrs[0].Split('=')[1];
                 string   y = coordinateStrs[1].Split('=')[1];
                 y = y.Substring(0, y.Length - 1);
                 originPoints.Add(new Point(double.Parse(x), double.Parse(y)));
                 RealVisualMap1.OriginalPoints.Add(new MapPoint(originPoints.Last().X, originPoints.Last().Y));
             }
         }
         RealVisualMap1.AdjustAxis();
     }
 }