private WinForms::ContextMenuStrip InitMenu() { WinForms::ContextMenuStrip contextMenu = new WinForms::ContextMenuStrip(); void MenuShow_Click(object Sender, EventArgs e) { notifierWindow.RestoreWindowState(); } void MenuClose_Click(object Sender, EventArgs e) { // Dispose and close the window which exits the app notifierWindow.Close(); contextMenu.Dispose(); trayIcon.Dispose(); Environment.Exit(0); } void MenuConsole_Click(object Sender, EventArgs e) { Process.Start(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "WFN.exe")); } void MenuShowActivity_Click(object Sender, EventArgs e) { App.GetActivityWindow().Show(); } contextMenu.Items.Add(Messages.NotifierTrayIcon_ShowNotifier, null, MenuShow_Click); contextMenu.Items.Add(Messages.NotifierTrayIcon_OpenConsole, null, MenuConsole_Click); contextMenu.Items.Add(Messages.NotifierTrayIcon_ShowActivityWindow, null, MenuShowActivity_Click); contextMenu.Items.Add(Messages.NotifierTrayIcon_DiscardAndClose, null, MenuClose_Click); return(contextMenu); }
private WinForms::ContextMenuStrip InitMenu() { var contextMenu = new WinForms::ContextMenuStrip(); contextMenu.Items.Add(Messages.NotifierTrayIcon_ShowNotifier, null, MenuShow_Click); contextMenu.Items.Add(Messages.NotifierTrayIcon_OpenConsole, null, MenuConsole_Click); contextMenu.Items.Add(Messages.NotifierTrayIcon_ShowActivityWindow, null, MenuShowActivity_Click); contextMenu.Items.Add(Messages.NotifierTrayIcon_DiscardAndClose, null, MenuClose_Click); return(contextMenu); }