Class SearchFilter.SearchFilterCollection
- Namespace
- Microsoft.Exchange.WebServices.Data
- Assembly
- Microsoft.Exchange.WebServices.dll
Represents a collection of search filters linked by a logical operator. Applications can use SearchFilterCollection to define complex search filters such as "Condition1 AND Condition2".
public sealed class SearchFilter.SearchFilterCollection : SearchFilter, IEnumerable<SearchFilter>, IEnumerable
- Inheritance
-
SearchFilter.SearchFilterCollection
- Implements
- Inherited Members
Constructors
SearchFilterCollection()
Initializes a new instance of the SearchFilter.SearchFilterCollection class. The LogicalOperator property is initialized to LogicalOperator.And.
public SearchFilterCollection()
SearchFilterCollection(LogicalOperator)
Initializes a new instance of the SearchFilter.SearchFilterCollection class.
public SearchFilterCollection(LogicalOperator logicalOperator)
Parameters
logicalOperator
LogicalOperatorThe logical operator used to initialize the collection.
SearchFilterCollection(LogicalOperator, params SearchFilter[])
Initializes a new instance of the SearchFilter.SearchFilterCollection class.
public SearchFilterCollection(LogicalOperator logicalOperator, params SearchFilter[] searchFilters)
Parameters
logicalOperator
LogicalOperatorThe logical operator used to initialize the collection.
searchFilters
SearchFilter[]The search filters to add to the collection.
SearchFilterCollection(LogicalOperator, IEnumerable<SearchFilter>)
Initializes a new instance of the SearchFilter.SearchFilterCollection class.
public SearchFilterCollection(LogicalOperator logicalOperator, IEnumerable<SearchFilter> searchFilters)
Parameters
logicalOperator
LogicalOperatorThe logical operator used to initialize the collection.
searchFilters
IEnumerable<SearchFilter>The search filters to add to the collection.
Properties
Count
Gets the total number of search filters in the collection.
public int Count { get; }
Property Value
this[int]
Gets or sets the search filter at the specified index.
public SearchFilter this[int index] { get; set; }
Parameters
index
intThe zero-based index of the search filter to get or set.
Property Value
- SearchFilter
The search filter at the specified index.
LogicalOperator
Gets or sets the logical operator that links the serach filters in this collection.
public LogicalOperator LogicalOperator { get; set; }
Property Value
Methods
Add(SearchFilter)
Adds a search filter of any type to the collection.
public void Add(SearchFilter searchFilter)
Parameters
searchFilter
SearchFilterThe search filter to add. Available search filter classes include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and SearchFilter.SearchFilterCollection.
AddRange(IEnumerable<SearchFilter>)
Adds multiple search filters to the collection.
public void AddRange(IEnumerable<SearchFilter> searchFilters)
Parameters
searchFilters
IEnumerable<SearchFilter>The search filters to add. Available search filter classes include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and SearchFilter.SearchFilterCollection.
Clear()
Clears the collection.
public void Clear()
Contains(SearchFilter)
Determines whether a specific search filter is in the collection.
public bool Contains(SearchFilter searchFilter)
Parameters
searchFilter
SearchFilterThe search filter to locate in the collection.
Returns
- bool
True is the search filter was found in the collection, false otherwise.
GetEnumerator()
Gets an enumerator that iterates through the elements of the collection.
public IEnumerator<SearchFilter> GetEnumerator()
Returns
- IEnumerator<SearchFilter>
An IEnumerator for the collection.
Remove(SearchFilter)
Removes a search filter from the collection.
public void Remove(SearchFilter searchFilter)
Parameters
searchFilter
SearchFilterThe search filter to remove.
RemoveAt(int)
Removes the search filter at the specified index from the collection.
public void RemoveAt(int index)
Parameters
index
intThe zero-based index of the search filter to remove.