public bool ProcessKey(string controlType, ICommandTarget ct, Keys keyData) { Dictionary <int, CommandID> bindings; if (this.KeyBindings.TryGetValue(controlType, out bindings)) { if (ct != null) { if (KeyBindings.TryGetValue(ct.GetType().FullName, out bindings)) { CommandID cmdID; if (bindings.TryGetValue((int)keyData, out cmdID)) { return(ct.Execute(cmdID)); } } return(false); } } if (KeyBindings.TryGetValue("", out bindings)) { CommandID cmdID; if (bindings.TryGetValue((int)keyData, out cmdID)) { if (this.target.Execute(cmdID)) { return(true); } } } return(false); }
private void item_Click(object sender, CommandMenuEventArgs e) { MenuCommand cmd = e.Item.MenuCommand; if (cmd != null) { target.Execute(cmd.CommandID); } }
public bool Execute(CommandID cmdId) { ICommandTarget ct = ActiveCommandTarget(); if (ct == null) { return(false); } return(ct.Execute(cmdId)); }
public CommandResult ExtendedGoOnline(ICoreObject cpu) { var GoOnlineCommands = new GoOnlineCommands(); IDlc dlc_GoOnlineCommands = GoOnlineCommands as IDlc; dlc_GoOnlineCommands.Attach(PersistenceWorkingContext); ICommandTarget ict_GoOnlineCommands = GoOnlineCommands as ICommandTarget; ICommand command = CommandProcessor.CreateCommand("Application.ExtendedGoOnline", new object[1] { cpu }, new NameObjectCollection()); command.WorkingContext = projectWorkingContext; return(ict_GoOnlineCommands.Execute(command)); }
public void Execute(string commandName, CommandInvocationSource invocationSource) { this.OnCommandExecuting(new CommandExecutionEventArgs(commandName)); ICommandTarget target = this.targets.GetTarget(commandName); if (this.feedbackService != null) { this.feedbackService.AddDataToStream2(1, this.feedbackService.GetFeedbackValue(commandName), (int)invocationSource); } if (target == null) { return; } PerformanceUtility.StartPerformanceSequence(PerformanceEvent.CommandExecute, commandName); target.Execute(commandName, invocationSource); PerformanceUtility.EndPerformanceSequence(PerformanceEvent.CommandExecute, commandName); this.OnCommandExecuted(new CommandExecutionEventArgs(commandName)); }
public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) { var commandId = new CommandID(pguidCmdGroup, (int)nCmdID); bool isSupported = _commandTarget.HandlesCommand(commandId); if (!isSupported) { return(NextCommandTarget.Exec(ref pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut)); } try { _commandTarget.Execute(commandId); return(VSConstants.S_OK); } catch (Exception e) { Logger.LogException(e, "Error executing editor command."); return(Marshal.GetHRForException(e)); } }
public CommandResult GoOnlineCommands_Excute(ICommand command) { ICommandTarget ict = GoOnlineCommands as ICommandTarget; return(ict.Execute(command)); }
void ICommand.Execute(object parameter) => commandTarget.Execute(group, cmdId);