Beispiel #1
0
        private void mainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (configIsChanged)
            {
                DialogResult result = MessageBox.Show(saveMsg, saveMsg_title,
                                                      MessageBoxButtons.YesNo,
                                                      MessageBoxIcon.Information,
                                                      MessageBoxDefaultButton.Button1,
                                                      MessageBoxOptions.DefaultDesktopOnly);

                if (result == DialogResult.Yes)
                {
                    XDocument xdoc = new XDocument(new XElement("configurations",
                                                                new XElement("config",
                                                                             new XAttribute("name", "userConfig"),
                                                                             new XElement("language", ts_cmb.SelectedIndex),
                                                                             new XElement("theme", currentTheme))));
                    xdoc.Save("configuration.xml");
                }
            }

            if (customFigureIsChange)
            {
                if (CustomFigure.savedFigures.Count >= 0)
                {
                    CustomFigure.SavingCustomFigures();
                }
            }
        }
Beispiel #2
0
 private void mainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (customFigureIsChange)
     {
         if (CustomFigure.savedFigures.Count > 0)
         {
             CustomFigure.SavingCustomFigures();
         }
     }
 }