Esempio n. 1
0
 /// <summary>
 /// Overloaded Constructor -- 4 --
 /// Icon = Application Icon (Default),
 /// Tooltip = Programmer must provide,
 /// Visibility = Programmer must provide,
 /// ContextMenu = Programmer must provide.
 /// </summary>
 public SystemTrayNotifyIcon(System.Windows.Forms.Form form, bool visible, string toolTip, ContextMenu contextMenu)
 {
     OnStatusChanged       += new SystemTrayNotifyIcon.StatusChanged(SystemTrayNotificationHandler);             // Setting Event Handler
     mainForm               = form;
     notifyIcon.Visible     = visible;
     notifyIcon.Icon        = mainForm.Icon;
     notifyIcon.Text        = toolTip;
     notifyIcon.ContextMenu = contextMenu;
     iconTimer              = new Timer();
     iconTimer.Interval     = timerInterval;
     iconTimer.Tick        += new EventHandler(TimerProc);
 }
Esempio n. 2
0
 /// <summary>
 /// Overloaded Constructor -- 3 --
 /// Icon = Programmer must provide,
 /// Tooltip = Programmer must provide,
 /// Visibility = Programmer must provide,
 /// ContextMenu = SystemTrayNotifyIcon class generated menu (Default).
 /// </summary>
 public SystemTrayNotifyIcon(System.Windows.Forms.Form form, bool visible, string toolTip, Icon icon)
 {
     OnStatusChanged   += new SystemTrayNotifyIcon.StatusChanged(SystemTrayNotificationHandler);                 // Setting Event Handler
     mainForm           = form;
     notifyIcon.Visible = visible;
     if (icon.Size.Height > 16 || icon.Size.Width > 16)
     {
         notifyIcon.Icon = mainForm.Icon;
     }
     else
     {
         notifyIcon.Icon = icon;
     }
     notifyIcon.Text        = toolTip;
     notifyIcon.ContextMenu = LoadDefaultContextMenu();
     iconTimer          = new Timer();
     iconTimer.Interval = timerInterval;
     iconTimer.Tick    += new EventHandler(TimerProc);
 }
Esempio n. 3
0
 /// <summary>
 /// Overloaded Constructor -- 5 --
 /// Icon = Programmer must provide,
 /// Tooltip = Programmer must provide,
 /// Visibility = Programmer must provide,
 /// ContextMenu = Programmer must provide.
 /// </summary>
 public SystemTrayNotifyIcon(System.Windows.Forms.Form form, bool visible, string toolTip, Icon icon, ContextMenu contextMenu)
 {
     OnStatusChanged += new SystemTrayNotifyIcon.StatusChanged(SystemTrayNotificationHandler);	// Setting Event Handler
     mainForm = form;
     notifyIcon.Visible = visible;
     if (icon.Size.Height > 16 || icon.Size.Width > 16)
         notifyIcon.Icon = mainForm.Icon;
     else
         notifyIcon.Icon = icon;
     notifyIcon.Text = toolTip;
     notifyIcon.ContextMenu = contextMenu;
     iconTimer = new Timer();
     iconTimer.Interval = timerInterval;
     iconTimer.Tick += new EventHandler(TimerProc);
 }
Esempio n. 4
0
 /// <summary>
 /// Overloaded Constructor -- 2 --
 /// Icon = Application Icon (Default),
 /// Tooltip = Programmer must provide,
 /// Visibility = Programmer must provide,
 /// ContextMenu = SystemTrayNotifyIcon class generated menu (Default).
 /// </summary>
 public SystemTrayNotifyIcon(System.Windows.Forms.Form form, bool visible, string toolTip)
 {
     OnStatusChanged += new SystemTrayNotifyIcon.StatusChanged(SystemTrayNotificationHandler);	// Setting Event Handler
     mainForm = form;
     notifyIcon.Visible = visible;
     notifyIcon.Icon = mainForm.Icon;
     notifyIcon.Text = toolTip;
     notifyIcon.ContextMenu = LoadDefaultContextMenu();
     iconTimer = new Timer();
     iconTimer.Interval = timerInterval;
     iconTimer.Tick += new EventHandler(TimerProc);
 }