Ejemplo n.º 1
0
        private void frmSplash_FormClosing(object sender, FormClosingEventArgs e)
        {
            //Saving of settings to local directory
            _timer1.Dispose();
            notifyIcon1.Visible            = false;
            Program.SettingsData.Alwaystop = toolStripMenuItem1.Checked;
            if (dontHideToolStripMenuItem.Checked)
            {
                Program.SettingsData.Hideset = 2;
            }
            else if (autoToolStripMenuItem.Checked)
            {
                Program.SettingsData.Hideset = 1;
            }
            else if (hideToolStripMenuItem.Checked)
            {
                Program.SettingsData.Hideset = 3;
            }
            else
            {
                Program.SettingsData.Hideset = 0;
            }
            notifyIcon1.Dispose();
            using (StreamWriter file = File.CreateText(Program.SETTINGS_DIRECTORY + "/Settings.Json"))
            {
                JsonSerializer serializer = new JsonSerializer();
                serializer.Formatting = Formatting.Indented;
                serializer.Serialize(file, Program.SettingsData);
            }

            settingsForm.Dispose();
            Expandedform.Dispose();
            Dispose();
        }