private void btnRestore_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.Title = "Select a Configuration Backup File"; openFileDialog1.Filter = "JSON Files|*.json"; if (openFileDialog1.ShowDialog() == DialogResult.OK) { StreamReader sr = new StreamReader(openFileDialog1.FileName); Properties.Settings.Default.HotKeys = sr.ReadToEnd(); sr.Close(); Properties.Settings.Default.Save(); HotKeyManager.parseHotKeys(); loadHotKeys(); } }
public static void Main() { using (Mutex mutex = new Mutex(false, "Global\\" + appGuid)) { if (!mutex.WaitOne(0, false)) { MessageBox.Show("Instance already running"); return; } initNotifyIcon(); HotKeyManager.parseHotKeys(); InterceptKeys.initKeyHook(); Application.EnableVisualStyles(); Application.Run(); InterceptKeys.terminateKeyHook(); } }