Exemple #1
0
        /// <summary>
        /// 订阅命令执行后的事件。
        /// </summary>
        /// <param name="callback">事件的回调函数。</param>
        /// <returns>当前 <see cref="IDbExecutor"/></returns>
        public IDbExecutor SubExecuted(ExecutedEventHandler callback)
        {
            if (callback == null)
            {
                throw new ArgumentNullException(nameof(callback));
            }

            Executed += callback;
            return(this);
        }
Exemple #2
0
        public CommandBinding(ICommand command, ExecutedEventHandler executed, CanExecuteEventHandler canExecute)
        {
            this.Command = command;

            if (executed != null)
            {
                this.Executed += new ExecutedEventHandler(executed);
            }

            if (canExecute != null)
            {
                this.CanExecute += new CanExecuteEventHandler(canExecute);
            }
        }
Exemple #3
0
        public CommandBinding(ICommand command, ExecutedEventHandler executed, CanExecuteEventHandler canExecute)
        {
            this.Command = command;

            if (executed != null)
            {
                this.Executed += new ExecutedEventHandler(executed);
            }

            if (canExecute != null)
            {
                this.CanExecute += new CanExecuteEventHandler(canExecute);
            }
        }
Exemple #4
0
 public CommandBinding(ICommand command, ExecutedEventHandler executed) : this(command, executed, null)
 {
 }
Exemple #5
0
 public CommandBinding(ICommand command, ExecutedEventHandler executed)
     : this(command, executed, null)
 {
 }