Ejemplo n.º 1
0
 /// <summary>
 /// Creates a new instance of the <see cref="DelegateLogCommand"/> class.
 /// </summary>
 /// <param name="executeLogCommand">The logic for <see cref="DelegateLogCommand.OnExecute(ILogCommandExecutionContext)" />.</param>
 /// <param name="canExecuteLogMessage">The logic for <see cref="DelegateLogCommand.CanExecute(ILogMessage)" />.</param>
 /// <param name="args">The execution arguments.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="executeLogCommand" /> is <see langword="null" />.
 /// </exception>
 public static DelegateLogCommand Create(ExecuteLogCommandHandler executeLogCommand,
                                         CanExecuteLogCommandHandler canExecuteLogMessage,
                                         IEnumerable <object> args)
 {
     return(Create(executeLogCommand,
                   canExecuteLogMessage,
                   CollectionHelper.AsArray(args)));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a new instance of the <see cref="DelegateLogCommand"/> class.
 /// </summary>
 /// <param name="executeLogCommand">The logic for <see cref="DelegateLogCommand.OnExecute(ILogCommandExecutionContext)" />.</param>
 /// <param name="canExecuteLogMessage">The logic for <see cref="DelegateLogCommand.CanExecute(ILogMessage)" />.</param>
 /// <param name="args">The execution arguments.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="executeLogCommand" /> is <see langword="null" />.
 /// </exception>
 public static DelegateLogCommand Create(ExecuteLogCommandHandler executeLogCommand,
                                         CanExecuteLogCommandHandler canExecuteLogMessage,
                                         params object[] args)
 {
     return(new DelegateLogCommand(executeLogCommand,
                                   canExecuteLogMessage,
                                   args));
 }
Ejemplo n.º 3
0
        private DelegateLogCommand(ExecuteLogCommandHandler executeLogCommand,
                                   CanExecuteLogCommandHandler canExecuteLogMessage,
                                   object[] args)
        {
            if (executeLogCommand == null)
            {
                throw new ArgumentNullException("executeLogCommand");
            }

            this._EXECUTE_LOG_MESSAGE     = executeLogCommand;
            this._CAN_EXECUTE_LOG_MESSAGE = canExecuteLogMessage ?? base.CanExecute;
            this._ARGUMENTS = args ?? new object[] { null };
        }