In This Article

StringFilterBase Class

Provides an abstract base class for a string IDataFilter implementation.

public abstract class StringFilterBase : DataFilterBase, IDataFilter
Inheritance:
object DataFilterBase object
Derived:
AutoCompleteBoxStringFilter PropertyModelStringFilter
Implements:
IDataFilter

Constructors

StringFilterBase()

Initializes an instance of the class.

protected StringFilterBase()

Properties

Operation

The string operation performed by this filter.

public StringFilterOperation Operation { get; set; }

Property Value

StringFilterOperation:

The default value is Contains.

RegexOptions

The options used for regex matches performed by this filter.

public RegexOptions RegexOptions { get; set; }

Property Value

RegexOptions:

The default value is RegexOptions.None.

StringComparison

The string comparison performed by this filter.

public StringComparison StringComparison { get; set; }

Property Value

StringComparison:

The default value is StringComparison.CurrentCultureIgnoreCase.

Value

The operand value used by this filter.

public string? Value { get; set; }

Property Value

string:

The default value is null.

Methods

FilterByString(string?, string?)

Examines the specified source string to see if it meets filter conditions.

protected virtual bool FilterByString(string? source, string? test)
Parameter Type Description
source string

The source string to examine.

test string

The test string.

Returns

bool:

true if the conditions for the filter are met by the source string; otherwise, false.

GetCaptures(string?, string?)

Returns the collection of filter match captures.

public virtual IEnumerable<StringFilterCapture>? GetCaptures(string? source, string? test)
Parameter Type Description
source string

The source text to examine.

test string

The text to match using the filter's Operation.

Returns

IEnumerable<StringFilterCapture>

Remarks

This feature only returns results for positive match operations (i.e., Contains) and not negative match operations (i.e., NotContains).

Fields

OperationProperty

Defines the Operation property.

public static readonly DependencyProperty OperationProperty

RegexOptionsProperty

Defines the RegexOptions property.

public static readonly DependencyProperty RegexOptionsProperty

StringComparisonProperty

Defines the StringComparison property.

public static readonly DependencyProperty StringComparisonProperty

ValueProperty

Defines the Value property.

public static readonly DependencyProperty ValueProperty

Inherited Members

Extension Methods