1.1 --- a/GUI/SensorNotifyIcon.cs Sat Jun 05 11:15:16 2010 +0000
1.2 +++ b/GUI/SensorNotifyIcon.cs Sat Jun 05 18:59:54 2010 +0000
1.3 @@ -61,7 +61,7 @@
1.4 private Pen pen;
1.5 private Font font;
1.6
1.7 - public SensorNotifyIcon(SensorSystemTray sensorSystemTray, ISensor sensor,
1.8 + public SensorNotifyIcon(SystemTray sensorSystemTray, ISensor sensor,
1.9 bool balloonTip)
1.10 {
1.11 this.sensor = sensor;
1.12 @@ -78,7 +78,13 @@
1.13 this.font = SystemFonts.MessageBoxFont;
1.14
1.15 ContextMenuStrip contextMenuStrip = new ContextMenuStrip();
1.16 - ToolStripMenuItem removeItem = new ToolStripMenuItem("Remove");
1.17 + ToolStripMenuItem hideShowItem = new ToolStripMenuItem("Hide/Show");
1.18 + hideShowItem.Click += delegate(object obj, EventArgs args) {
1.19 + sensorSystemTray.SendHideShowCommand();
1.20 + };
1.21 + contextMenuStrip.Items.Add(hideShowItem);
1.22 + contextMenuStrip.Items.Add(new ToolStripSeparator());
1.23 + ToolStripMenuItem removeItem = new ToolStripMenuItem("Remove Sensor");
1.24 removeItem.Click += delegate(object obj, EventArgs args) {
1.25 sensorSystemTray.Remove(this.sensor);
1.26 };
1.27 @@ -94,7 +100,16 @@
1.28 }
1.29 };
1.30 contextMenuStrip.Items.Add(colorItem);
1.31 + contextMenuStrip.Items.Add(new ToolStripSeparator());
1.32 + ToolStripMenuItem exitItem = new ToolStripMenuItem("Exit");
1.33 + exitItem.Click += delegate(object obj, EventArgs args) {
1.34 + sensorSystemTray.SendExitCommand();
1.35 + };
1.36 + contextMenuStrip.Items.Add(exitItem);
1.37 this.notifyIcon.ContextMenuStrip = contextMenuStrip;
1.38 + this.notifyIcon.DoubleClick += delegate(object obj, EventArgs args) {
1.39 + sensorSystemTray.SendHideShowCommand();
1.40 + };
1.41
1.42 this.bitmap = new Bitmap(16, 16, PixelFormat.Format32bppArgb);
1.43 this.graphics = Graphics.FromImage(this.bitmap);