From 94e3853032d72d4b831864f20858c555c5adf391 Mon Sep 17 00:00:00 2001 From: Niko Ehrenfeuchter <nikolaus.ehrenfeuchter@unibas.ch> Date: Mon, 15 Jan 2018 00:12:42 +0100 Subject: [PATCH] Add action for tray icon double click, rename method. Refers to #2 --- ATXTray/AutoTxTray.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ATXTray/AutoTxTray.cs b/ATXTray/AutoTxTray.cs index 5f13a9e..f52e7f2 100644 --- a/ATXTray/AutoTxTray.cs +++ b/ATXTray/AutoTxTray.cs @@ -41,6 +41,7 @@ namespace ATXTray public AutoTxTray() { _notifyIcon.Visible = true; _notifyIcon.Icon = new Icon("AutoTx.ico"); + _notifyIcon.DoubleClick += StartNewTransfer; // this doesn't work properly, the menu will not close etc. so we disable it for now: // _notifyIcon.Click += ShowContextMenu; @@ -76,7 +77,7 @@ namespace ATXTray _miTxProgress.Click += ShowContextMenu; _miTxEnqueue.Text = @"+++ Add new directory for transfer. +++"; - _miTxEnqueue.Click += _miTxEnqueue_Click; + _miTxEnqueue.Click += StartNewTransfer; _cmStrip.Items.AddRange(new ToolStripItem[] { _miTitle, @@ -142,7 +143,7 @@ namespace ATXTray _notifyIcon.ContextMenuStrip.Show(); } - private void _miTxEnqueue_Click(object sender, EventArgs e) { + private static void StartNewTransfer(object sender, EventArgs e) { var dirDialog = new CommonOpenFileDialog { Title = @"Select directory to be transferred", IsFolderPicker = true, -- GitLab