protected override void AfterNotifyIconConstructed(ChoNotifyIcon ni) { ni.Text = "Eazy Copy - Cinchoo"; ni.ContextMenuStrip.Items.Insert(1, new System.Windows.Forms.ToolStripMenuItem("Launch New Instance", System.Drawing.Image.FromStream(this.GetType().Assembly.GetManifestResourceStream("ChoEazyCopy.Resources.OpenNewWindow.png")), ((o, e) => { var info = new System.Diagnostics.ProcessStartInfo(ChoApplication.EntryAssemblyLocation); System.Diagnostics.Process.Start(info); }))); }
/// <summary> /// This class should be created and passed into Application.Run( ... ) /// </summary> public ChoApplicationContext(ChoApplicationHost appHost) { ChoGuard.ArgumentNotNull(appHost, "ApplicationHost"); _appHost = appHost; _mainForm = appHost.GetMainWindowObject(); _hasWindow = appHost.IsWindowApp; BuildDefaultContextMenu(); this._components = new System.ComponentModel.Container(); this.NotifyIcon = new ChoNotifyIcon(this._components); PreInitializeContext(appHost); ChoApplication.RaiseAfterNotifyIconConstructed(NotifyIcon); InitializeContext(appHost); _defaultTrayTipMsg = "{0} is running...".FormatString(ChoGlobalApplicationSettings.Me.ApplicationName); }
protected override void AfterNotifyIconConstructed(ChoNotifyIcon ni) { ni.Text = "ChoEazyCopy - Cinchoo"; ni.ContextMenuStrip.Items.Insert(1, new System.Windows.Forms.ToolStripMenuItem("Launch New Instance", System.Drawing.Image.FromStream(this.GetType().Assembly.GetManifestResourceStream("ChoEazyCopy.Resources.OpenNewWindow.png")), ((o, e) => { var info = new System.Diagnostics.ProcessStartInfo(ChoApplication.EntryAssemblyLocation); System.Diagnostics.Process.Start(info); }))); if (!IsRunAsAdmin()) { ni.ContextMenuStrip.Items.Insert(2, new System.Windows.Forms.ToolStripMenuItem("Run as Administrator", System.Drawing.Image.FromStream(this.GetType().Assembly.GetManifestResourceStream("ChoEazyCopy.Resources.Security.png")), ((o, e) => { AppHost.RunAsAdmin(); }))); } else { ni.ContextMenuStrip.Items.Insert(2, new System.Windows.Forms.ToolStripMenuItem("Register Shell Extensions", System.Drawing.Image.FromStream(this.GetType().Assembly.GetManifestResourceStream("ChoEazyCopy.Resources.Registry.png")), ((o, e) => { AppHost.RegisterShellExtensions(); }))); ni.ContextMenuStrip.Items.Insert(3, new System.Windows.Forms.ToolStripMenuItem("Unregister Shell Extensions", System.Drawing.Image.FromStream(this.GetType().Assembly.GetManifestResourceStream("ChoEazyCopy.Resources.RemoveRegistry.png")), ((o, e) => { AppHost.UnregisterShellExtensions(); }))); } }
protected override void OnWindowMinimize(ChoNotifyIcon notifyIcon) { ChoApplication.NotifyIcon.ShowBalloonTip(_defaultBalloonTipText, 500); }
internal void OnWindowMinimizeInternal(ChoNotifyIcon notifyIcon) { OnWindowMinimize(notifyIcon); }
protected virtual void OnWindowMinimize(ChoNotifyIcon notifyIcon) { }
protected virtual void AfterNotifyIconConstructed(ChoNotifyIcon ni) { }