Пример #1
0
        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);
            })));
        }
Пример #2
0
 /// <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);
 }
Пример #3
0
        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();
                })));
            }
        }
Пример #4
0
 protected override void OnWindowMinimize(ChoNotifyIcon notifyIcon)
 {
     ChoApplication.NotifyIcon.ShowBalloonTip(_defaultBalloonTipText, 500);
 }
Пример #5
0
 internal void OnWindowMinimizeInternal(ChoNotifyIcon notifyIcon)
 {
     OnWindowMinimize(notifyIcon);
 }
Пример #6
0
 protected virtual void OnWindowMinimize(ChoNotifyIcon notifyIcon)
 {
 }
Пример #7
0
 protected virtual void AfterNotifyIconConstructed(ChoNotifyIcon ni)
 {
 }