Esempio n. 1
0
 public Map(XElement xe)
 {
     if (string.IsNullOrEmpty(xe.AttValue("Stamp")))
     {
         _stamp = xe.Descendants("Record").Count() + 1;  // 自动适应旧版
     }
     else
     {
         _stamp = Convert.ToInt32(xe.AttValue("Stamp"));
     }
     Name       = xe.AttValue("Name");
     Properties = new Dictionary <string, string>();
     Layers     = new LayerCollection();
     if (xe.Elements("Properties").Count() > 0)
     {
         foreach (var prop in xe.Elements("Properties").First().Attributes())
         {
             Properties.Add(prop.Name.ToString(), prop.Value);
         }
     }
     foreach (var layer in xe.Elements("Table"))
     {
         Layers.Add(new VectorLayer(layer));
     }
 }
Esempio n. 2
0
 public Map()
 {
     Name       = string.Empty;
     Properties = new Dictionary <string, string>();
     Layers     = new LayerCollection();
 }