StringFilterBase Class
Provides an abstract base class for a string IDataFilter implementation.
public abstract class StringFilterBase : DataFilterBase, IDataFilter
- Inheritance:
- object DataFilterBase object
- Implements:
- IDataFilter
Constructors
StringFilterBase()
Initializes an instance of the class.
protected StringFilterBase()
Properties
Operation
Gets or sets the string operation performed by this filter.
public StringFilterOperation Operation { get; set; }
Property Value
- StringFilterOperation:
The string operation performed by this filter. The default value is
StringFilterOperation.Contains
.
RegexOptions
Gets or sets the options used for regex matches performed by this filter.
public RegexOptions RegexOptions { get; set; }
Property Value
- RegexOptions:
The options used for regex matches performed by this filter. The default value is
RegexOptions.None
.
StringComparison
Gets or sets the string comparison performed by this filter.
public StringComparison StringComparison { get; set; }
Property Value
- StringComparison:
The string comparison performed by this filter. The default value is
StringComparison.CurrentCultureIgnoreCase
.
Value
Gets or sets the operand value used by this filter.
public string Value { get; set; }
Property Value
- string:
The operand value used by this filter. 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>:
The collection of filter match captures.
Remarks
This feature only returns results for positive match operations (i.e. Contains) and not negative match operations (i.e. NotContains).
Fields
OperationProperty
Identifies the Operation dependency property. This field is read-only.
public static readonly DependencyProperty OperationProperty
RegexOptionsProperty
Identifies the RegexOptions dependency property. This field is read-only.
public static readonly DependencyProperty RegexOptionsProperty
StringComparisonProperty
Identifies the StringComparison dependency property. This field is read-only.
public static readonly DependencyProperty StringComparisonProperty
ValueProperty
Identifies the Value dependency property. This field is read-only.
public static readonly DependencyProperty ValueProperty