private void ShowAboutMenuItemHandler(object sender, EventArgs e) { var optionsdlg = new MetroOptionsDlg(this, MetroOptionsDlg.Page.About); optionsdlg.Closed += (o, args) => { if (_trayIcon != null) { _trayIcon.ContextMenu = new ContextMenu(BuildContextMenu()); } }; optionsdlg.Show(); }
private void ShowAboutMenuItemHandler(object sender, EventArgs e) { if (Application.OpenForms.OfType <MetroOptionsDlg>().Count() > 0) { var form = Application.OpenForms.OfType <MetroOptionsDlg>().First(); form.SetTab(MetroOptionsDlg.Page.About); } else { var optionsdlg = new MetroOptionsDlg(this, MetroOptionsDlg.Page.About); optionsdlg.RepoListingChanged += (o, args) => { _trayIcon.ContextMenu = new ContextMenu(BuildContextMenu()); }; optionsdlg.Closed += (o, args) => { if (_trayIcon != null) { _trayIcon.ContextMenu = new ContextMenu(BuildContextMenu()); } }; optionsdlg.Show(); } }