public void Jumplist_ShowPreferences(String[] arguments) { Preferences prefs = Shellscape.Program.FindForm(typeof(Preferences)) as Preferences; if (prefs != null) { if (arguments != null && arguments.Length >= 1 && arguments[0] == "refresh") { prefs.Close(); prefs.Dispose(); prefs = null; } } if(prefs == null) { prefs = new Preferences(); } MethodInvoker method = delegate() { // yes, all this ugly is necessary. prefs.Show(); prefs.TopMost = true; prefs.BringToFront(); prefs.Focus(); prefs.TopMost = false; }; if (prefs.InvokeRequired) { prefs.Invoke(method); } else { method(); } }
public void Jumplist_ShowPreferences(String[] arguments) { Preferences prefs = Shellscape.Program.FindForm(typeof(Preferences)) as Preferences; String arg = String.Empty; if(arguments != null && arguments.Length >= 1) { arg = arguments[0]; } if(prefs != null) { if(arg == "refresh") { prefs.Close(); prefs.Dispose(); prefs = null; } } if(prefs == null) { prefs = new Preferences(); } MethodInvoker method = delegate() { // yes, all this ugly is necessary. if(arg == "firstrun") { prefs.InitFirstRun(); } else if(arg == "account") { // a quick hack to show an account from the thumbnail preview without rocking the boat here. prefs.ShowAccount(arguments[1]); } prefs.Show(); prefs.TopMost = true; prefs.BringToFront(); prefs.Focus(); prefs.TopMost = false; }; if(prefs.InvokeRequired) { prefs.Invoke(method); } else { method(); } }
private void _SettingsWindow_FormClosed(object sender, FormClosedEventArgs e) { _preferences.Dispose(); _preferences = null; }