From bde4849465a8f9bf67c4d41364b30dbbfa125042 Mon Sep 17 00:00:00 2001 From: stax76 Date: Wed, 1 Dec 2021 14:09:31 +0100 Subject: [PATCH] menu issue fix --- README.md | 6 ++---- src/Misc/MainForm.cs | 11 +++++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 2c2f1f27..aa5dc807 100644 --- a/README.md +++ b/README.md @@ -165,9 +165,7 @@ The command palette based playlist showing my favorite artist of the stax record ![Playlist](docs/img/Playlist.png) -Related apps ------------- - -Find a list of related apps: +List of my apps +--------------- https://stax76.github.io/frankskare diff --git a/src/Misc/MainForm.cs b/src/Misc/MainForm.cs index a7e22319..00d0acfc 100644 --- a/src/Misc/MainForm.cs +++ b/src/Misc/MainForm.cs @@ -666,10 +666,12 @@ public void BuildMenu() foreach (CommandItem item in items) { - if (string.IsNullOrEmpty(item.Path)) + var tempItem = item; + + if (string.IsNullOrEmpty(tempItem.Path)) continue; - var menuItem = MenuHelp.Add(ContextMenu.Items, item.Path); + var menuItem = MenuHelp.Add(ContextMenu.Items, tempItem.Path); if (menuItem != null) { @@ -679,7 +681,8 @@ public void BuildMenu() MenuAutoResetEvent.WaitOne(); System.Windows.Application.Current.Dispatcher.Invoke( DispatcherPriority.Background, new Action(delegate { })); - Core.Command(item.Command); + if (!string.IsNullOrEmpty(tempItem.Command)) + Core.Command(tempItem.Command); }); } catch (Exception ex) { @@ -687,7 +690,7 @@ public void BuildMenu() } }; - menuItem.InputGestureText = item.Input; + menuItem.InputGestureText = tempItem.Input; } } }