//TODO -- make this be ICommand for the enabled public ActionMenuItem(IContextualAction action) { _action = action; Header = action.Description; this.SetIcon(action.Icon); Click += (s, e) => _action.Execute(); }
public void RunNode(TreeNode node) { IContextualAction action = null; //Something smells. I can't quite make out what it is. Oh wait, it's this LSP violation. if (node.Subject is Suite) { action = _screenObjects.CommandForSubject <RunSuiteCommand, Suite>(node.Subject); } else { action = _screenObjects.CommandForSubject <RunTestCommand, Test>(node.Subject); } if (action != null) { action.Execute(); } }