moved context menu code and made setup function, also added 'still running' balloontip
This commit is contained in:
parent
8486aefdf8
commit
c84e2381e3
1 changed files with 15 additions and 5 deletions
|
@ -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);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue