/// <summary> /// Saves settings when form is closed /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Main_FormClosed(object sender, FormClosedEventArgs e) { XmlDocument doc = new XmlDocument(); XmlElement settings = doc.CreateElement(XmlName); settings.AppendChild(manager.SaveToXml(doc)); doc.AppendChild(settings); doc.Save(SettingsFile); Logger.Close(); }