/// <summary> /// Save settings to file /// </summary> /// <param name="fileName">Xml-file name</param> /// <param name="settings">Settings</param> public static void SaveToXml(string fileName, LicSettingsInfo settings) { XmlSerializer s = new XmlSerializer(typeof(LicSettingsInfo)); using (FileStream writer = new FileStream(fileName, FileMode.Create)) using (XmlWriter xmlWriter = XmlWriter.Create(writer, XmlUtils.GetXmlWriterSettings())) { s.Serialize(xmlWriter, settings); } }
/// <summary> /// Load settings from Xml-file /// </summary> /// <param name="fileName">Xml-file name in user folder</param> /// <returns>List of settings</returns> public static LicSettingsInfo LoadFromXml(string fileName) { XmlSerializer s = new XmlSerializer(typeof(LicSettingsInfo)); LicSettingsInfo settings = null; using (XmlReader xmlReader = XmlReader.Create(fileName, XmlUtils.GetXmlReaderSettings())) { settings = ((LicSettingsInfo)s.Deserialize(xmlReader)); } return(settings); }
/// <summary> /// Initializes a new instance of the <see cref="QueryPreparator"/> class. /// </summary> /// <param name="settings"> /// The settings. /// </param> public QueryPreparator(LicSettingsInfo settings, ILogger logger) { this.settings = settings; this.logger = logger; }