public CommandBarItemCollection(ICommandService commandService, CommandInvocationSource invocationSource, ItemCollection items, bool displayShortcut) { this.commandService = commandService; this.invocationSource = invocationSource; this.items = items; this.displayShortcut = displayShortcut; }
/// <summary> /// Reports that the given command is starting its execution, typically to be called right at the /// begining of the command's handler method. /// </summary> /// <param name="command">The name of the command. Must not be null.</param> /// <param name="invocationSource">From where the command was invoked.</param> public static void ReportCommand(CommandName command, CommandInvocationSource invocationSource) { ActivityLogUtils.LogInfo($"Reporting: Starting command {command} from source {invocationSource}"); s_reporter.Value?.ReportEvent( category: command.ToString(), action: invocationSource.ToString()); }
public CommandBarButton(ICommandService commandService, string command, CommandInvocationSource invocationSource) : base(commandService, command) { this.invocationSource = invocationSource; this.Click += new RoutedEventHandler(this.Me_Click); this.UpdateText(); this.UpdateEnabled(); }
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 CommandBarItemCollection(ICommandService commandService, CommandInvocationSource invocationSource, ItemCollection items) : this(commandService, invocationSource, items, true) { }
public void Execute(string commandName, CommandInvocationSource invocationSource) { this.commands[commandName].Execute(); }