1
Fork 0

moved context menu code and made setup function, also added 'still running' balloontip

This commit is contained in:
Jake Howard 2014-11-04 17:26:59 +00:00
parent 8486aefdf8
commit c84e2381e3

View file

@ -10,19 +10,29 @@ namespace Saviour_Backup_System
class notificationIcon class notificationIcon
{ {
internal NotifyIcon notifyIcon = new NotifyIcon() ; internal NotifyIcon notifyIcon = new NotifyIcon() ;
internal static ContextMenu contextMenu = new ContextMenu(); internal ContextMenu contextMenu = new ContextMenu();
internal notificationIcon() internal notificationIcon()
{ {
contextMenu.MenuItems.Add("Show Interface", displayWindow);
notifyIcon.Text = "Saviour Backup System"; notifyIcon.Text = "Saviour Backup System";
notifyIcon.Icon = Properties.Resources.redCDIconICO; notifyIcon.Icon = Properties.Resources.redCDIconICO;
populateList();
notifyIcon.ContextMenu = contextMenu; notifyIcon.ContextMenu = contextMenu;
notifyIcon.Visible = true; //finally displays the tray icon notifyIcon.Visible = true; //finally displays the tray icon
} }
private void populateList()
{
contextMenu.MenuItems.Add("Show Interface", displayWindow);
private static void displayWindow(object sender, EventArgs e) { setup.MW.Show(); } }
private void displayWindow(object sender, EventArgs e) { setup.MW.showDisplay(); }
internal void displayStillRunning() {
notifyIcon.BalloonTipText = "Saviour backup system is still running in the background";
notifyIcon.BalloonTipTitle = "Still running...";
notifyIcon.ShowBalloonTip(2000);
}
} }
} }