private void btnSave_Click(object sender, RoutedEventArgs e) { OptionsIO optio = new OptionsIO(MainWindow.SettingsFile); OptionsObject opt=new OptionsObject(); opt.RunOnStartup = RunOnStartup; opt.ShowHotkey = ShowHotkey; opt.ExitHotkey = ExitHotkey; opt.ScrollHotkey = ScrollHotkey; optio.Write(opt); winmain.ShowHotkey = ShowHotkey; winmain.ExitHotkey = ExitHotkey; winmain.ScrollHotkey = ScrollHotkey; winmain.RunOnStartup = RunOnStartup; if (RunOnStartup) winmain.CreateShortcut(); else winmain.DeleteShortcut(); winmain.ShowHideOptions(); }
private void InitOptions() { if (!File.Exists(SettingsFile)) { OptionsObject opt = new OptionsObject(); opt.RunOnStartup = RunOnStartup; opt.ShowHotkey = ShowHotkey; opt.ExitHotkey = ExitHotkey; opt.ScrollHotkey = ScrollHotkey; OptionsIO optio = new OptionsIO(SettingsFile); optio.Write(opt); InTutorialMode = true; } else { OptionsObject opt = new OptionsIO(SettingsFile).Read(); ShowHotkey = opt.ShowHotkey; ExitHotkey = opt.ExitHotkey; ScrollHotkey = opt.ScrollHotkey; RunOnStartup = opt.RunOnStartup; InTutorialMode = false; } if (!RunOnStartup) DeleteShortcut(); else CreateShortcut(); OptionsWindow = new options(winmain); OptionsWindow.Show(); MoveX(OptionsWindow, 0, -(int)OptionsWindow.Width, 0); //tutorialmode = true; }