예제 #1
0
 static bool Save(string configurationFilename, XmlSerializer serial, DustConfig data, ILogger logs)
 {
     try
     {
         using (var file = File.OpenWrite(configurationFilename))
         {
             serial.Serialize(file, data);
         }
         return(true);
     }
     catch (Exception e)
     {
         logs.Error("Can't save configuration file.", e);
         return(false);
     }
 }
예제 #2
0
        public static bool Save(Type configurationType, List <Assembly> assemblies, string configurationFilename, DustConfig data, ILogger logs)
        {
            XmlSerializer serial = new XmlSerializer(configurationType, LoadTypeList(assemblies).ToArray());

            return(Save(configurationFilename, serial, data, logs));
        }