Пример #1
0
 public CommandBarItemCollection(ICommandService commandService, CommandInvocationSource invocationSource, ItemCollection items, bool displayShortcut)
 {
     this.commandService   = commandService;
     this.invocationSource = invocationSource;
     this.items            = items;
     this.displayShortcut  = displayShortcut;
 }
Пример #2
0
        /// <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());
        }
Пример #3
0
 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();
 }
Пример #4
0
        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));
        }
Пример #5
0
 public CommandBarItemCollection(ICommandService commandService, CommandInvocationSource invocationSource, ItemCollection items)
     : this(commandService, invocationSource, items, true)
 {
 }
Пример #6
0
 public void Execute(string commandName, CommandInvocationSource invocationSource)
 {
     this.commands[commandName].Execute();
 }