コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: Debugging.cs プロジェクト: num0005/Mutation
 public ConsoleCommand(string cmd, ExecuteEventHandler onExecuteHandler, params string[] args)
 {
     // Set fields
     Command   = cmd;
     Execute   = onExecuteHandler;
     Arguments = args;
 }
コード例 #3
0
 public CommandBinding(RoutedCommand command, ExecuteEventHandler executeEventHandler,
                       QueryEnabledEventHandler queryEnabledEventHandler)
 {
     _command                  = command;
     _executeEventHandler      = executeEventHandler;
     _queryEnabledEventHandler = queryEnabledEventHandler;
 }
コード例 #4
0
 public CommandBinding(RoutedCommand command, ExecuteEventHandler executeEventHandler,
                       QueryEnabledEventHandler queryEnabledEventHandler)
 {
   _command = command;
   _executeEventHandler = executeEventHandler;
   _queryEnabledEventHandler = queryEnabledEventHandler;
 }
コード例 #5
0
        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;
        }
コード例 #6
0
 public RecentItemsCommand(IBlogPostEditingSite postEditingSite)
     : base(CommandId.MRUList)
 {
     this.postEditingSite = postEditingSite;
     ExecuteWithArgs     += new ExecuteEventHandler(RecentItemsCommand_ExecuteWithArgs);
 }
コード例 #7
0
 public Command Add(Command command, ExecuteEventHandler handler)
 {
     command.ExecuteWithArgs += handler;
     Add(command);
     return command;
 }
コード例 #8
0
 public DelegateCommand(ExecuteEventHandler <T> executeEventHandler, CanExecuteEventHandler <T> canExecuteEventHandler)
 {
     ExecuteEventHandler    = executeEventHandler;
     CanExecuteEventHandler = canExecuteEventHandler;
 }
コード例 #9
0
 public DelegateCommand(ExecuteEventHandler <T> executeEventHandler)
     : this(executeEventHandler, null)
 {
 }
コード例 #10
0
 public Command Add(Command command, ExecuteEventHandler handler)
 {
     command.ExecuteWithArgs += handler;
     Add(command);
     return(command);
 }
コード例 #11
0
 public CommandBinding(RoutedCommand command, ExecuteEventHandler executeEventHandler)
     : this(command, executeEventHandler, null)
 {
 }
コード例 #12
0
 public CommandBinding(RoutedCommand command, ExecuteEventHandler executeEventHandler)
   : this(command, executeEventHandler, null) {}