Skip to content
Snippets Groups Projects
Commit 26a52619 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Use global const AppTitle.

Refers to #2
parent 8bcb2c50
Branches
Tags
No related merge requests found
...@@ -11,6 +11,7 @@ namespace ATXTray ...@@ -11,6 +11,7 @@ namespace ATXTray
{ {
public class AutoTxTray : ApplicationContext public class AutoTxTray : ApplicationContext
{ {
private const string AppTitle = "AutoTx Service Monitor";
private static readonly Timer AppTimer = new Timer(1000); private static readonly Timer AppTimer = new Timer(1000);
private static readonly string _serviceDir = @"C:\Tools\AutoTx"; private static readonly string _serviceDir = @"C:\Tools\AutoTx";
private static readonly string ConfigFile = Path.Combine(_serviceDir, "configuration.xml"); private static readonly string ConfigFile = Path.Combine(_serviceDir, "configuration.xml");
...@@ -41,7 +42,7 @@ namespace ATXTray ...@@ -41,7 +42,7 @@ namespace ATXTray
_miExit.Click += MiExitClick; _miExit.Click += MiExitClick;
_miTitle.Font = new Font(_cmStrip.Font, FontStyle.Bold); _miTitle.Font = new Font(_cmStrip.Font, FontStyle.Bold);
_miTitle.Text = @"AutoTx Service Monitor"; _miTitle.Text = AppTitle;
_miTitle.Image = Image.FromFile("AutoTx.ico"); _miTitle.Image = Image.FromFile("AutoTx.ico");
_miTitle.BackColor = Color.LightCoral; _miTitle.BackColor = Color.LightCoral;
_miTitle.Click += ShowContextMenu; _miTitle.Click += ShowContextMenu;
...@@ -146,14 +147,14 @@ namespace ATXTray ...@@ -146,14 +147,14 @@ namespace ATXTray
_miSvcRunning.BackColor = Color.LightGreen; _miSvcRunning.BackColor = Color.LightGreen;
_miTitle.BackColor = Color.LightGreen; _miTitle.BackColor = Color.LightGreen;
_miSvcSuspended.Enabled = true; _miSvcSuspended.Enabled = true;
_notifyIcon.ShowBalloonTip(500, "AutoTx Monitor", _notifyIcon.ShowBalloonTip(500, AppTitle,
"Service started.", ToolTipIcon.Info); "Service running.", ToolTipIcon.Info);
} else { } else {
_miSvcRunning.Text = @"Service NOT RUNNING!"; _miSvcRunning.Text = @"Service NOT RUNNING!";
_miSvcRunning.BackColor = Color.LightCoral; _miSvcRunning.BackColor = Color.LightCoral;
_miTitle.BackColor = Color.LightCoral; _miTitle.BackColor = Color.LightCoral;
_miSvcSuspended.Enabled = false; _miSvcSuspended.Enabled = false;
_notifyIcon.ShowBalloonTip(500, "AutoTx Monitor", _notifyIcon.ShowBalloonTip(500, AppTitle,
"Service stopped.", ToolTipIcon.Error); "Service stopped.", ToolTipIcon.Error);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment