/// <summary> /// Allows all characters specified by <paramref name="filter"/> through the filter. /// </summary> /// <returns> /// The 'this' instance. /// </returns> public CodePointFilter AllowFilter([NotNull] ICodePointFilter filter) { foreach (var allowedCodePoint in filter.GetAllowedCodePoints()) { // If the code point can't be represented as a BMP character, skip it. char codePointAsChar = (char)allowedCodePoint; if (allowedCodePoint == codePointAsChar) { _allowedCharsBitmap.AllowCharacter(codePointAsChar); } } return(this); }
/// <summary> /// Allows all characters specified by <paramref name="filter"/> through the filter. /// </summary> /// <returns> /// The 'this' instance. /// </returns> public CodePointFilter AllowFilter(ICodePointFilter filter) { if (filter == null) { throw new ArgumentNullException("filter"); } foreach (var allowedCodePoint in filter.GetAllowedCodePoints()) { // If the code point can't be represented as a BMP character, skip it. char codePointAsChar = (char)allowedCodePoint; if (allowedCodePoint == codePointAsChar) { _allowedCharactersBitmap.AllowCharacter(codePointAsChar); } } return(this); }
/// <summary> /// Allows all characters specified by <paramref name="filter"/> through the filter. /// </summary> /// <returns> /// The 'this' instance. /// </returns> public CodePointFilter AllowFilter(ICodePointFilter filter) { if (filter == null) { throw new ArgumentNullException(nameof(filter)); } foreach (var allowedCodePoint in filter.GetAllowedCodePoints()) { // If the code point can't be represented as a BMP character, skip it. char codePointAsChar = (char)allowedCodePoint; if (allowedCodePoint == codePointAsChar) { _allowedCharsBitmap.AllowCharacter(codePointAsChar); } } return this; }