private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { Settings.Default.Window_x = Location.X; Settings.Default.Window_y = Location.Y; if (_gameList.SelectedGame != null) { Settings.Default.last_game = _gameList.SelectedGame.Name; } SettingsManager.WriteSettingsToFile(); }
private void SaveSettings() { //Enums Settings.Default.art_area = _cmbArtView.SelectedIndex; Settings.Default.art_type = _cmbArtType.SelectedIndex; //Checkboxes Settings.Default.GameListManufacturer = _chkManu.Checked; Settings.Default.GameListYear = _chkYear.Checked; Settings.Default.rotate_background = _chkRotateBackground.Checked; Settings.Default.large_icon = _chkItemZoom.Checked; Settings.Default.non_working_overlay = _chkArtNonWorking.Checked; Settings.Default.hide_nonworking_mechanical_games = _chkShowMechanical.Checked; Settings.Default.filter_on_input = _chkInputFilter.Checked; //Favorites Settings.Default.favorites_mode = _cmdFavMode.SelectedIndex; //Font Settings.Default.game_list_font = gameFont; Settings.Default.info_font = infoFont; //Command line Settings.Default.command_line_switches = autoCompleteTextBox1.Text; //Colors Settings.Default.info_font_color = infoColor; Settings.Default.game_list_color = _colorPickerParent.Color; Settings.Default.game_list_clone_color = _colorPickerClone.Color; Settings.Default.favorites_color = _colorPickerFav.Color; Settings.Default.art_border_color = _colorPickerBorder.Color; //BorderUpDown Settings.Default.art_border_width = Convert.ToInt32(_borderWidth.Value); //Opacity Settings.Default.art_opacity = _trackBarOpacity.Value; //Background if (_bgImageChanged) { Settings.Default.bkground_image = _backgroundImage; Settings.Default.bkground_directory = _backgroundPath; } //Logic to change background //1. Rotate initally off, turned on, but the background image wasn't changed. Change BG now if (!_initialBackgroundValue && !_bgImageChanged && _chkRotateBackground.Checked) { SettingsManager.GetBackgroundImage(); _picBG.Image = SettingsManager.BackgroundImage; _initialBackgroundValue = true; } //2. Checkback was initially off, but user pressed on and off again several times WITHOUT // changing the background image - as that takes precedence. else if ((_initialBackgroundValue && !_bgImageChanged && !_chkRotateBackground.Checked)) { _initialBackgroundValue = false; } //Art View Paths string Paths = ""; SettingsManager.ArtPaths = new List <string>(); SettingsManager.ArtPaths.Add("None"); foreach (var item in _listArtViews.Items) { SettingsManager.ArtPaths.Add(item.ToString()); Paths += item.ToString() + '|'; } Paths.TrimEnd('|'); Settings.Default.art_view_folders = Paths; SettingsManager.WriteSettingsToFile(); if (ConfigSaved != null) { ConfigSaved(null, null); } }