WINDOWSSERVICEWRAPPER/Program.cs
/// <summary>
/// Construct the toolbar icon, context menu and click events.
/// </summary>
Construct the toolbar icon, context menu and click events.
Construct the toolbar icon context menu and click events .
private static void IntializeIcon()
        {
            appIcon = new NotifyIcon();
            appIcon.Icon = WindowsServiceWrapper.Properties.Resources.ServiceStart;
            appIcon.Visible = true;
            mnu = new ContextMenu();
            MenuItem configItem = new MenuItem("Configuration Manager");
            configItem.DefaultItem = true;
            configItem.Click += new EventHandler(ConfigItem_Click);
            mnu.MenuItems.Add(configItem);
            mnu.MenuItems.Add("-");
            MenuItem startItem = new MenuItem("Start Compare Cloudware EMailer Service");
            startItem.Click += new EventHandler(StartItem_Click);
            startItem.Name = "Start Compare Cloudware EMailer Service";
            mnu.MenuItems.Add(startItem);
            mnu.MenuItems.Add("-");
            MenuItem stopItem = new MenuItem("Stop Compare Cloudware EMailer Service");
            stopItem.Click += new EventHandler(StopItem_Click);
            stopItem.Name = "Stop Compare Cloudware EMailer Service";
            mnu.MenuItems.Add(stopItem);
            mnu.MenuItems.Add("-");
            MenuItem closeItem = new MenuItem("Exit");
            closeItem.Click += new EventHandler(CloseItem_Click);
            mnu.MenuItems.Add(closeItem);
            appIcon.ContextMenu = mnu;
            appIcon.Text = "Compare Cloudware EMailer Service Monitor";
            appIcon.DoubleClick += new EventHandler(ConfigItem_Click);
        }
private static void IntializeIcon ( ) { appIcon = new NotifyIcon ( ) ; appIcon . Icon = WindowsServiceWrapper . Properties . Resources . ServiceStart ; appIcon . Visible = true ; mnu = new ContextMenu ( ) ; MenuItem configItem = new MenuItem ( " " ) ; configItem . DefaultItem = true ; configItem . Click += new EventHandler ( ConfigItem_Click ) ; mnu . MenuItems . Add ( configItem ) ; mnu . MenuItems . Add ( " " ) ; MenuItem startItem = new MenuItem ( " " ) ; startItem . Click += new EventHandler ( StartItem_Click ) ; startItem . Name = " " ; mnu . MenuItems . Add ( startItem ) ; mnu . MenuItems . Add ( " " ) ; MenuItem stopItem = new MenuItem ( " " ) ; stopItem . Click += new EventHandler ( StopItem_Click ) ; stopItem . Name = " " ; mnu . MenuItems . Add ( stopItem ) ; mnu . MenuItems . Add ( " " ) ; MenuItem closeItem = new MenuItem ( " " ) ; closeItem . Click += new EventHandler ( CloseItem_Click ) ; mnu . MenuItems . Add ( closeItem ) ; appIcon . ContextMenu = mnu ; appIcon . Text = " " ; appIcon . DoubleClick += new EventHandler ( ConfigItem_Click ) ; }
Construct the toolbar icon, context menu and click events.
Construct the toolbar icon context menu and click events .