コード例 #1
0
 private void SaveRestartAppButton_Click(object sender, EventArgs e)
 {
     settings.TrackGameTime      = GameTimeCheckbox.Checked;
     settings.DisableUpdateTimer = DisableUpdateTimerCBox.Checked;
     if (settings.HasChanged)
     {
         DatabaseFile.Write(settings, PathInfos.SettingsPath);
         Application.Restart();
     }
     else
     {
         Close();
     }
 }
コード例 #2
0
        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (LaunchParametersTB.Text != settings.CommandLine)
            {
                settings.CommandLine = LaunchParametersTB.Text;
            }

            if (settings.HasChanged)
            {
                Log.WriteLine(nameof(settings.HasChanged) + ", so writing to disk");
                DatabaseFile.Write(settings, PathInfos.SettingsPath);
                Log.WriteLine("Wrote settings to disk");
            }
        }
コード例 #3
0
        private void Hotkeys_Load(object sender, EventArgs e)
        {
            oldSettings = new Settings();
            oldSettings = settings;

            DatabaseFile.Write(settings, PathInfos.SettingsPath); //save current settings
            settings.HasChanged = false;                          //force it to not be changed so exit without saving works 'properly'

            //transparent label backcolor
            var pos = PointToScreen(label2.Location);

            pos              = pictureBox1.PointToClient(pos);
            label2.Parent    = pictureBox1;
            label2.Location  = pos;
            label2.BackColor = System.Drawing.Color.Transparent;
        }
コード例 #4
0
        static Settings()
        {
            string applicationDataDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\CoDUO FoV Changer";

            settingsFile = applicationDataDirectory + @"\settings.xml";
            if (!Directory.Exists(applicationDataDirectory))
            {
                Directory.CreateDirectory(applicationDataDirectory);
            }
            if (File.Exists(settingsFile))
            {
                instance = DatabaseFile.Read <Settings>(settingsFile);
            }
            else
            {
                instance = new Settings();
                DatabaseFile.Write(instance, settingsFile);
            }
        }
コード例 #5
0
 private void button2_Click(object sender, EventArgs e)
 {
     DatabaseFile.Write(settings, PathInfos.SettingsPath);
     Close();
 }