示例#1
0
 public static void WriteSettings(ShapeLayerSettings settings, string fileName)
 {
     var xmlSer = new XmlSerializer(settings.GetType());
     using (var sw = new StreamWriter(fileName))
     {
         xmlSer.Serialize(sw, settings);
     }
 }
示例#2
0
 public static ShapeLayerSettings GetSettings(string fileName)
 {
     var settings = new ShapeLayerSettings();
     try
     {
         var xmlSer = new XmlSerializer(settings.GetType());
         using (var sr = new StreamReader(fileName))
         {
             settings = (ShapeLayerSettings)xmlSer.Deserialize(sr);
         }
     }
     catch (Exception)
     {
        
     }
     return settings;
 }