From d84509e761c6b7b3f3b0b85c8f563048bc07543b Mon Sep 17 00:00:00 2001 From: Thomas Nind Date: Mon, 18 Oct 2021 10:47:59 +0100 Subject: [PATCH] Fixed constructor to match expectations --- .../CommandExecution/GoDartsPluginMenu.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/GoDartsPluginUI/CommandExecution/GoDartsPluginMenu.cs b/GoDartsPluginUI/CommandExecution/GoDartsPluginMenu.cs index b26bf7e..fbc9f7c 100644 --- a/GoDartsPluginUI/CommandExecution/GoDartsPluginMenu.cs +++ b/GoDartsPluginUI/CommandExecution/GoDartsPluginMenu.cs @@ -1,5 +1,6 @@ using GoDartsPluginUI.CommandExecution.AtomicCommands; using Rdmp.Core; +using Rdmp.Core.CommandExecution; using Rdmp.Core.CommandExecution.AtomicCommands; using Rdmp.Core.Providers.Nodes; using Rdmp.UI.ItemActivation; @@ -9,20 +10,20 @@ namespace GoDartsPluginUI.CommandExecution { public class GoDartsPluginMenu : PluginUserInterface { - public GoDartsPluginMenu(IActivateItems itemActivator) : base(itemActivator) + IActivateItems activator; + + public GoDartsPluginMenu(IBasicActivateItems itemActivator) : base(itemActivator) { + activator = itemActivator as IActivateItems; } public override IEnumerable GetAdditionalRightClickMenuItems(object o) { - var serverNode = o as AllServersNode; - if (serverNode == null) - return null; - - if(BasicActivator is IActivateItems a) + if(activator != null && o is AllServersNode) { - return new[] { new ExecuteCommandSetupGoFusionFromDatabase(a) }; + return new[] { new ExecuteCommandSetupGoFusionFromDatabase(activator) }; } + return base.GetAdditionalRightClickMenuItems(o); } }