/// <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="args">The execution arguments.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="executeLogCommand" /> is <see langword="null" />. /// </exception> public static DelegateLogCommand Create(ExecuteLogCommandHandler executeLogCommand, params object[] args) { return(Create(executeLogCommand, (CanExecuteLogCommandHandler)null, args)); }
/// <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))); }
/// <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)); }
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 }; }