Esempio n. 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);
        }
Esempio n. 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);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 4
0
 public CommandBinding(ICommand command, ExecutedEventHandler executed) : this(command, executed, null)
 {
 }
Esempio n. 5
0
 public CommandBinding(ICommand command, ExecutedEventHandler executed)
     : this(command, executed, null)
 {
 }