public CommandExecutingEventArgs(CommandContext context, bool cancel = false) { if(context == null) throw new ArgumentNullException(nameof(context)); _context = context; _cancel = cancel; }
public CommandExecutingEventArgs(object parameter, IDictionary<string, object> extendedProperties = null, bool cancel = false) { var context = parameter as CommandContext; if(context != null) { _context = context; if(extendedProperties != null && extendedProperties.Count > 0) { foreach(var pair in extendedProperties) context.ExtendedProperties[pair.Key] = pair.Value; } } else { _parameter = parameter; _extendedProperties = extendedProperties; } _cancel = cancel; }