public BlogProviderButtonManager(CommandManager commandManager) : base(CommandId.BlogProviderButtonsGallery, false) { AllowSelection = false; lock (_commandsLock) { // initialize commands for (int i = 0; i < _commands.Length; i++) { _commands[i] = new Command(); _commands[i].Identifier = String.Format(CultureInfo.InvariantCulture, BlogProviderButtonCommandBarInfo.ProviderCommandFormat, i); _commands[i].Execute += new EventHandler(BlogProviderButton_Execute); _commands[i].CommandBarButtonStyle = CommandBarButtonStyle.Provider; _commands[i].On = false; } ExecuteWithArgs += new ExecuteEventHandler(BlogProviderButtonManager_ExecuteWithArgs); // add them to the command manager commandManager.Add(new CommandCollection(_commands)); commandManager.Add(this); } commandViewWeblog = commandManager.Add(CommandId.ViewWeblog, commandViewWeblog_Execute); commandViewWeblogAdmin = commandManager.Add(CommandId.ViewWeblogAdmin, commandViewWeblogAdmin_Execute); }
public ConsoleCommand(string cmd, ExecuteEventHandler onExecuteHandler, params string[] args) { // Set fields Command = cmd; Execute = onExecuteHandler; Arguments = args; }
public CommandBinding(RoutedCommand command, ExecuteEventHandler executeEventHandler, QueryEnabledEventHandler queryEnabledEventHandler) { _command = command; _executeEventHandler = executeEventHandler; _queryEnabledEventHandler = queryEnabledEventHandler; }
public AlignmentCommand(CommandManager commandManager) : base(CommandId.AlignmentGallery, Alignment.None) { _commandAlignmentGroup = new GroupCommand(CommandId.AlignmentGroup, this); commandManager.Add(_commandAlignmentGroup); ExecuteWithArgs += new ExecuteEventHandler(AlignmentCommand_ExecuteWithArgs); // By default, we are disabled _commandAlignmentGroup.Enabled = false; base.Enabled = false; }
public RecentItemsCommand(IBlogPostEditingSite postEditingSite) : base(CommandId.MRUList) { this.postEditingSite = postEditingSite; ExecuteWithArgs += new ExecuteEventHandler(RecentItemsCommand_ExecuteWithArgs); }
public Command Add(Command command, ExecuteEventHandler handler) { command.ExecuteWithArgs += handler; Add(command); return command; }
public DelegateCommand(ExecuteEventHandler <T> executeEventHandler, CanExecuteEventHandler <T> canExecuteEventHandler) { ExecuteEventHandler = executeEventHandler; CanExecuteEventHandler = canExecuteEventHandler; }
public DelegateCommand(ExecuteEventHandler <T> executeEventHandler) : this(executeEventHandler, null) { }
public Command Add(Command command, ExecuteEventHandler handler) { command.ExecuteWithArgs += handler; Add(command); return(command); }
public CommandBinding(RoutedCommand command, ExecuteEventHandler executeEventHandler) : this(command, executeEventHandler, null) { }
public CommandBinding(RoutedCommand command, ExecuteEventHandler executeEventHandler) : this(command, executeEventHandler, null) {}