private void MenuItemToolsPreferences_Click(object sender, RoutedEventArgs e) { if (!context.scoutLoaded) { return; } WindowPreferences w = new WindowPreferences(); w.Owner = this; w.Opacity = 0; settings.settingSettings = false; w.Show(); settings.settingSettings = true; globalFuncs.FadeInElement(w, globalFuncs.windowDuration, globalFuncs.windowFinalOpacity, true); }
public void saveSettings(View.WindowPreferences windowPreferences) { SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.InitialDirectory = globalFuncs.applicationDirectory + "\\Settings"; saveFileDialog.DefaultExt = "set"; // The Filter property requires a search string after the pipe ( | ) saveFileDialog.Filter = "Settings(*.set)|*.set"; saveFileDialog.Title = "Save a settings file"; saveFileDialog.ShowDialog(); // If the file name is not an empty string open it for saving. if (saveFileDialog.FileName != "") { string filename = saveFileDialog.FileName; if (filename.Substring(filename.Length - 11, 11).ToLower().Equals("default.set")) { filename = filename.Substring(0, filename.Length - 4); filename += "1.str"; } string name = filename.Substring(filename.LastIndexOf("\\") + 1, filename.LastIndexOf(".") - filename.LastIndexOf("\\") - 1); saveSettingsFile(name, ref windowPreferences); } }