private void ConsoleOutputWindow_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.C && e.Control) { AemActions.StopInstance(mAemInstance); } }
static void Application_ThreadExit(object sender, EventArgs e) { // automatically stop instances that are still running on exit try { if (Program.InstanceList != null) { foreach (AemInstance instance in Program.InstanceList) { Process process = instance.GetInstanceJavaProcess(); if (process != null && !process.HasExited) { try { AemActions.StopInstance(instance); instance.NotifyIcon.Visible = false; instance.NotifyIcon.Dispose(); instance.NotifyIcon = null; } catch (Exception ex) { mLog.Error("Error stopping instance '" + instance.Name + "'.", ex); } } } } } catch (Exception ex) { mLog.Error("Error checking for running instances or application shutdown.", ex); } }
private void timerBundleStatus_Tick(object sender, EventArgs e) { foreach (AemInstance instance in Program.InstanceList) { if (instance.ShowInTaskbar) { instance.UpdateNofiyIconText(AemActions.GetCombinedBundleStatus(instance)); } } }
private void InitializeNotifyIcon() { if (mNotifyIcon == null) { mNotifyIcon = new NotifyIcon(); mNotifyIcon.DoubleClick += new EventHandler(mNotifyIcon_DoubleClick); } ContextMenu contextMenu = new ContextMenu(); MenuItem nameMenuItem = new MenuItem(this.Name + " (" + AemInstanceTypeUtil.GetLabel(this.AemInstanceType) + ")"); nameMenuItem.Enabled = false; contextMenu.MenuItems.Add(nameMenuItem); contextMenu.MenuItems.Add(new MenuItem("-")); AemActions.AddControlMenuItems(contextMenu.MenuItems, this); contextMenu.MenuItems.Add(new MenuItem("-")); AemActions.AddLogMenuItems(contextMenu.MenuItems, this); contextMenu.MenuItems.Add(new MenuItem("-")); AemActions.AddOpenMenuItems(contextMenu.MenuItems, this, true); contextMenu.MenuItems.Add(new MenuItem("-")); contextMenu.MenuItems.Add(new MenuItem("Properties", propertiesMenuItem_Click)); this.NotifyIcon.ContextMenu = contextMenu; mNotifyIcon.Text = this.Name; mNotifyIcon.Visible = this.ShowInTaskbar; string trayIcon = "trayicon_disabled"; mNotifyIcon.Icon = IconCache.GetIcon(this.IconSet, this.CustomIconPath, trayIcon); }
void mNotifyIcon_DoubleClick(object sender, EventArgs e) { AemActions.OpenAuthorPublish(this, e); }
private void dgInstances_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { // select instance below mousepointer DataGridView.HitTestInfo hitTestInfo = this.dgInstances.HitTest(e.X, e.Y); if (hitTestInfo.RowIndex >= 0) { dgInstances.CurrentCell.Selected = false; dgInstances.CurrentCell = dgInstances[0, hitTestInfo.RowIndex]; } AemInstance instance = this.SelectedInstanceInListview; if (instance == null) { return; } // Context-Menü initialisieren List <MenuItem> menuItems = new List <MenuItem>(); MenuItem item; item = new MenuItem(); item.Text = "&Add..."; item.Click += new EventHandler(addToolStripMenuItem_Click); menuItems.Add(item); item = new MenuItem(); item.Text = "&Edit..."; item.DefaultItem = true; item.Click += new EventHandler(editToolStripMenuItem_Click); menuItems.Add(item); item = new MenuItem(); item.Text = "&Duplicate..."; item.Click += new EventHandler(copyToolStripMenuItem_Click); menuItems.Add(item); item = new MenuItem(); item.Text = "&Remove"; item.Click += new EventHandler(removeToolStripMenuItem_Click); menuItems.Add(item); item = new MenuItem(); item.Text = "-"; menuItems.Add(item); item = new MenuItem(); item.Text = "&Show in Taskbar"; item.Click += new EventHandler(setShowInTaskbarToolStripMenuItem_Click); item.Checked = instance.ShowInTaskbar; menuItems.Add(item); dgInstances.ContextMenu = new ContextMenu(menuItems.ToArray()); dgInstances.ContextMenu.MenuItems.Add("-"); AemActions.AddControlMenuItems(dgInstances.ContextMenu.MenuItems, instance); dgInstances.ContextMenu.MenuItems.Add("-"); AemActions.AddOpenMenuItems(dgInstances.ContextMenu.MenuItems, instance, false); dgInstances.ContextMenu.MenuItems.Add("-"); AemActions.AddLogMenuItems(dgInstances.ContextMenu.MenuItems, instance); dgInstances.ContextMenu.Show(dgInstances, e.Location); } }