From 25965456a403d3c06be234bcf48c9d2dd97c9647 Mon Sep 17 00:00:00 2001
From: Niko Ehrenfeuchter <nikolaus.ehrenfeuchter@unibas.ch>
Date: Fri, 9 Feb 2018 11:25:10 +0100
Subject: [PATCH] Indicate the exit wrapper method by making it an overloaded
 variant.

---
 ATxTray/AutoTxTray.cs | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/ATxTray/AutoTxTray.cs b/ATxTray/AutoTxTray.cs
index 8e998bd..abdf7db 100644
--- a/ATxTray/AutoTxTray.cs
+++ b/ATxTray/AutoTxTray.cs
@@ -133,7 +133,7 @@ namespace ATxTray
         private void SetupContextMenu() {
             Log.Trace("Building context menu...");
             _miExit.Text = @"Exit";
-            _miExit.Click += MiExitClick;
+            _miExit.Click += AutoTxTrayExit;
 
             _miTitle.Font = new Font(_cmStrip.Font, FontStyle.Bold);
             _miTitle.Text = AppTitle;
@@ -176,13 +176,23 @@ namespace ATxTray
             _notifyIcon.ContextMenuStrip = _cmStrip;
             Log.Trace("Finished building context menu.");
         }
-        
+
+        /// <summary>
+        /// Clean up the tray icon and shut down the application.
+        /// </summary>
         private void AutoTxTrayExit() {
             _notifyIcon.Visible = false;
             Log.Info("Shutting down {0}.", AppTitle);
             Application.Exit();
         }
 
+        /// <summary>
+        /// Wrapper for AutoTxTrayExit to act as an event handler.
+        /// </summary>
+        private void AutoTxTrayExit(object sender, EventArgs e) {
+            AutoTxTrayExit();
+        }
+
         /// <summary>
         /// Update the tooltip making sure not to exceed the 63 characters limit.
         /// </summary>
@@ -232,10 +242,6 @@ namespace ATxTray
             _statusFileChanged = true;
         }
 
-        private void MiExitClick(object sender, EventArgs e) {
-            AutoTxTrayExit();
-        }
-
         private void ShowContextMenu(object sender, EventArgs e) {
             // just show the menu again, to avoid that clicking the menu item closes the context
             // menu without having to disable the item (which would grey out the text and icon):
-- 
GitLab