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); } }
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)); }