/// <summary> /// Excludes the <paramref name="parameterName"/> from checks for <see cref="ArgumentNullException"/>. /// </summary> /// <param name="filter">The <see cref="Regex"/> filter.</param> /// <param name="parameterName">The parameter name.</param> /// <param name="typeFullName">The <see cref="Type.FullName"/> of the <see cref="Type"/>.</param> /// <param name="methodName">The method name.</param> /// <returns>The <paramref name="filter"/>.</returns> /// <exception cref="ArgumentNullException">The <paramref name="filter"/> or <paramref name="parameterName"/> /// parameters are <see langword="null"/>.</exception> public static IRegexFilter ExcludeParameter( this IRegexFilter filter, string parameterName, string typeFullName = null, string methodName = null) { return(filter.AddParameterRule( parameterName, include: false, typeFullName: typeFullName, methodName: methodName)); }
/// <summary> /// Includes the <paramref name="parameterName"/> for checks for <see cref="ArgumentNullException"/>. Overrides /// any parameter rules that may exclude the <paramref name="parameterName"/>. /// </summary> /// <param name="filter">The <see cref="Regex"/> filter.</param> /// <param name="parameterName">The parameter name.</param> /// <param name="typeFullName">The <see cref="Type.FullName"/> of the <see cref="Type"/>.</param> /// <param name="methodName">The method name.</param> /// <returns>The <paramref name="filter"/>.</returns> /// <exception cref="ArgumentNullException">The <paramref name="filter"/> or <paramref name="parameterName"/> /// parameters are <see langword="null"/>.</exception> public static IRegexFilter IncludeParameter( this IRegexFilter filter, string parameterName, string typeFullName = null, string methodName = null) { // If the method or type type is specified ensure they are included // otherwise the parameter may never be included. if (!string.IsNullOrWhiteSpace(methodName)) { filter.IncludeMethod(methodName, typeFullName); } else if (!string.IsNullOrWhiteSpace(typeFullName)) { filter.IncludeType(typeFullName); } return(filter.AddParameterRule( parameterName, include: true, typeFullName: typeFullName, methodName: methodName)); }