CommandLoader(IWpfCommandService wpfCommandService, EditBodyCommand editBodyCmd) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DOCUMENTVIEWER_UICONTEXT); ICommand editBodyCmd2 = editBodyCmd; cmds.Add(EditBodyCommand, (s, e) => editBodyCmd2.Execute(null), (s, e) => e.CanExecute = editBodyCmd2.CanExecute(null), ModifierKeys.Control | ModifierKeys.Shift, Key.E); }
public override bool IsEnabled(CodeContext context) => !EditBodyCommand.IsVisibleInternal(editCodeVMCreator, context.MenuItemContextOrNull) && context.IsDefinition && EditMethodBodyCodeCommand.CanExecute(editCodeVMCreator, context.Nodes);