ITextFilterObserver Interface
Definition
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
valueReadOnlySpan<char>The value that was evaluated.
decisionTextFilterDecisionThe decision reached.
patternTextFilterPatternThe pattern that decided the outcome, or null when the decision is IncludedByDefault or NotIncluded.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |