Table of Contents

ITextFilterObserver Interface

Definition

Namespace
Bodu.Text.Filtering
Assembly
Bodu.Text.Filtering.dll
Package
Bodu.Text.Filtering 1.0.0
Source
ITextFilterObserver.cs

Receives a callback for every value a TextFilter evaluates, carrying the decision reached and the pattern that decided it.

public interface ITextFilterObserver
Extension Methods

Remarks

Attach an implementation via Observer to see exactly which values matched, which were rejected, and by which pattern - for diagnostics, sampling, or audit logging. When no observer is attached the filter's evaluation path pays only a single null check.

The callback runs synchronously on the evaluating thread, once per evaluated value; exceptions it throws propagate to the caller of the evaluating member. Implementations should be fast and must not re-enter the filter.

Methods

OnEvaluated(ReadOnlySpan<char>, TextFilterDecision, TextFilterPattern?)

Called after the filter reaches a decision for one evaluated value.

void OnEvaluated(ReadOnlySpan<char> value, TextFilterDecision decision, TextFilterPattern? pattern)

Parameters

value ReadOnlySpan<char>

The value that was evaluated.

decision TextFilterDecision

The decision reached.

pattern TextFilterPattern

The pattern that decided the outcome, or null when the decision is IncludedByDefault or NotIncluded.

Applies to

ProductVersions
.NET8, 10