Skip to content

Commit

Permalink
Fixed constructor to match expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
tznind committed Oct 18, 2021
1 parent e8b0445 commit d84509e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions GoDartsPluginUI/CommandExecution/GoDartsPluginMenu.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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<IAtomicCommand> 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);
}
}
Expand Down

0 comments on commit d84509e

Please sign in to comment.