MessageFilterTable<TFilterData> 类

定义

提供筛选器表的通用实现。Provides the generic implementation of a filter table.

generic <typename TFilterData>
public ref class MessageFilterTable : System::Collections::Generic::ICollection<System::Collections::Generic::KeyValuePair<System::ServiceModel::Dispatcher::MessageFilter ^, TFilterData>>, System::Collections::Generic::IDictionary<System::ServiceModel::Dispatcher::MessageFilter ^, TFilterData>, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<System::ServiceModel::Dispatcher::MessageFilter ^, TFilterData>>, System::ServiceModel::Dispatcher::IMessageFilterTable<TFilterData>
[System.Runtime.Serialization.DataContract]
public class MessageFilterTable<TFilterData> : System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.ServiceModel.Dispatcher.MessageFilter,TFilterData>>, System.Collections.Generic.IDictionary<System.ServiceModel.Dispatcher.MessageFilter,TFilterData>, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.ServiceModel.Dispatcher.MessageFilter,TFilterData>>, System.ServiceModel.Dispatcher.IMessageFilterTable<TFilterData>
type MessageFilterTable<'FilterData> = class
    interface IMessageFilterTable<'FilterData>
    interface IDictionary<MessageFilter, 'FilterData>
    interface ICollection<KeyValuePair<MessageFilter, 'FilterData>>
    interface seq<KeyValuePair<MessageFilter, 'FilterData>>
    interface IEnumerable
Public Class MessageFilterTable(Of TFilterData)
Implements ICollection(Of KeyValuePair(Of MessageFilter, TFilterData)), IDictionary(Of MessageFilter, TFilterData), IEnumerable(Of KeyValuePair(Of MessageFilter, TFilterData)), IMessageFilterTable(Of TFilterData)

类型参数

TFilterData

与筛选器关联的FilterData的类型。The type of the FilterData associated with the filter.

继承
MessageFilterTable<TFilterData>
属性
实现

注解

MessageFilterTable<TFilterData> 可以接受任何类型的筛选器。A MessageFilterTable<TFilterData> accepts filters of any type. 它在内部将这些筛选器分组到包含所有给定类型的筛选器的表。It groups them internally into tables that contain all the filters of a given type. 添加筛选器时,会将其放置在包含此类筛选器的内部筛选器表(如果已存在)中。When a filter is added, it is put into an internal filter table, if one already exists, which contains filters of its type. 如果不存在此筛选器表,则调用 CreateFilterTable 以分配一个适当类型的新筛选器表。If no such table exists, CreateFilterTable is called to allocate a new filter table of the appropriate type. 默认操作是调用 CreateFilterTableIts default operation is to call CreateFilterTable.

可以重写此默认行为,以显式指定与筛选器类型关联的筛选器表的类型。This default behavior can be overridden to explicitly specify the type of filter table associated with a type of filter. 第一次将筛选器类型添加到此表时,所创建的筛选器表类型将永久与此筛选器类型关联。The first time a filter type is added to the table, the filter table type created is permanently associated with the filter type.

优先级是一个整数值,用于将筛选器分组为优先级存储桶,并对它们的处理进行排序。The priority is an integer value used to group filters into priority buckets and order their processing. 分配给筛选器类型的整数越大,该筛选器类型的处理优先级就越高。The larger the integer assigned to a filter type, the higher its priority for processing. 将一起计算优先级存储桶中的所有筛选器表。All the filter tables in a priority bucket are evaluated together. 如果较高优先级存储桶未提供任何匹配项,则只会计算较低优先级存储桶。Lower priority buckets are only evaluated if higher priority buckets do not provide any matches. 筛选器表向添加的筛选器分配一个可进行设置的默认优先级。A filter table assigns a default priority that can be set to filters being added.

构造函数

MessageFilterTable<TFilterData>()

初始化默认优先级为 0 的 MessageFilterTable<TFilterData> 类的一个新实例。Initializes a new instance of the MessageFilterTable<TFilterData> class with a default priority of 0.

MessageFilterTable<TFilterData>(Int32)

初始化具有指定初始默认优先级的 MessageFilterTable<TFilterData> 类的一个新实例。Initializes a new instance of the MessageFilterTable<TFilterData> class with the specified initial default priority.

属性

Count

获取筛选器表中 filter/FilterData 对的数目。Gets the number of filter/FilterData pairs in the filter table.

DefaultPriority

获取或设置筛选器表的默认优先级。Gets or sets the default priority for the filter table.

IsReadOnly

获取指示筛选器表是否为只读的值。Gets a value that indicates whether the filter table is read-only.

Item[MessageFilter]

获取或设置与指定的 filter 关联的筛选数据。Gets or sets the filter data associated with the specified filter.

Keys

获取筛选器表中包含的所有筛选器的集合。Gets a collection of all the filters contained in the filter table.

Values

获取筛选器表中包含的所有 FilterData 的集合。Gets a collection of all the FilterData contained in the filter table.

方法

Add(KeyValuePair<MessageFilter,TFilterData>)

将 filter/FilterData(键/值)对添加到筛选器表。Adds a filter/FilterData (key/value) pair to the filter table.

Add(MessageFilter, TFilterData)

将筛选器及其关联的 FilterData 添加到筛选器表。Adds a filter and its associated FilterData to the filter table.

Add(MessageFilter, TFilterData, Int32)

将筛选器及其关联的 FilterData 添加到具有指定优先级的操作筛选器表中。Adds a filter and its associated FilterData to the action filter table with a specified priority.

Clear()

从筛选器表中移除所有筛选器及其关联的数据。Removes all filters and their associated data from the filter table.

Contains(KeyValuePair<MessageFilter,TFilterData>)

确定筛选器表是否包含指定的筛选器及其关联的 FilterDataDetermines whether the filter table contains a specified filter and its associated FilterData.

ContainsKey(MessageFilter)

确定筛选器表是否包含指定的筛选器。Determines whether the filter table contains a specified filter.

CopyTo(KeyValuePair<MessageFilter,TFilterData>[], Int32)

将 filter/FilterData 对复制到从指定索引开始的数组。Copies the filter/FilterData pairs to an array that starts at a specified index.

CreateFilterTable(MessageFilter)

为指定类型的筛选器实例化筛选器表。Instantiates a filter table for a specified type of filter.

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetEnumerator()

返回一个循环访问筛选器表的枚举数。Returns an enumerator that iterates through the filter table.

GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetMatchingFilter(Message, MessageFilter)

返回一个值,该值指示指定的消息是否正好满足表中的一个筛选器的匹配标准,然后在 out 参数中返回该筛选器。Returns a value that indicates whether the match criterion of exactly one filter in the table is satisfied by the specified message and returns that filter in an out parameter.

GetMatchingFilter(MessageBuffer, MessageFilter)

返回一个值,该值指示指定的消息是否正好满足表中的一个筛选器的匹配标准,然后在 out 参数中返回该筛选器。Returns a value that indicates whether the match criterion of exactly one filter in the table is satisfied by the specified message and returns that filter in an out parameter.

GetMatchingFilters(Message, ICollection<MessageFilter>)

返回一个值,该值指示指定的消息是否满足表中 MessageFilter 的匹配条件,然后将匹配筛选器添加到集合。Returns a value that indicates whether the match criterion of an MessageFilter in the table is satisfied by the specified message, and adds the matching filters to a collection.

GetMatchingFilters(MessageBuffer, ICollection<MessageFilter>)

返回一个值,该值指示指定的缓冲消息是否满足表中至少一个筛选器的匹配条件,然后将最高优先级筛选器组(其中至少存在一个匹配项)中的匹配筛选器添加到集合。Returns a value that indicates whether the match criterion of at least one filter in the table is satisfied by the specified buffered message and adds the matching filters from the highest priority set of filters in which at least one match is found to a collection.

GetMatchingValue(Message, TFilterData)

返回一个值,该值指示指定的消息是否正好满足表中的一个 MessageFilter 的匹配条件,然后将匹配筛选数据添加到集合。Returns a value that indicates whether the match criterion of exactly one MessageFilter in the table is satisfied by the specified message and adds the matching filter data to a collection.

GetMatchingValue(MessageBuffer, TFilterData)

返回一个值,该值指示指定的缓冲消息是否正好满足表中的一个筛选器的匹配条件,然后将匹配筛选数据添加到集合。Returns a value that indicates whether the match criterion of exactly one filter in the table is satisfied by the specified buffered message and adds the matching filter data to a collection.

GetMatchingValues(Message, ICollection<TFilterData>)

返回一个值,该值指示指定的消息或缓冲消息是否满足表中至少一个筛选器的匹配条件,然后将匹配筛选器的 FilterData 添加到集合。Returns a value that indicates whether the match criterion of at least one filter in the table is satisfied by the specified message or buffered message and adds the FilterData of the matching filters to a collection.

GetMatchingValues(MessageBuffer, ICollection<TFilterData>)

返回一个值,该值指示指定的消息缓冲区是否正好满足表中一个筛选器的匹配条件,以及是否将匹配筛选器的 FilterData 添加到 results 集合中。Returns a value that indicates whether the match criterion of exactly one filter in the table is satisfied by the specified message buffer and adds the FilterData of the matching filters to the results collection.

GetPriority(MessageFilter)

返回表中给定筛选器的优先级。Returns the priority of a given filter in the table.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
Remove(KeyValuePair<MessageFilter,TFilterData>)

从筛选器表中移除指定的 filter/FilterData 对。Removes a specified filter/FilterData pair from the filter table.

Remove(MessageFilter)

从筛选器表中移除筛选器及其关联的 FilterDataRemoves a filter and its associated FilterData from the filter table.

ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)
TryGetValue(MessageFilter, TFilterData)

检查筛选器是否存储在筛选器表中。Checks whether a filter is stored in the filter table.

显式界面实现

IEnumerable.GetEnumerator()

返回一个循环访问筛选器表的枚举数。Returns an enumerator that iterates through the filter table.

扩展方法

CopyToDataTable<T>(IEnumerable<T>)

在给定其泛型参数 TDataTable 的输入 DataRow 对象的情况下,返回包含 IEnumerable<T> 对象副本的 DataRowReturns a DataTable that contains copies of the DataRow objects, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption)

在给定其泛型参数 TDataRow 的输入 DataTable 对象的情况下,将 IEnumerable<T> 对象复制到指定的 DataRowCopies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler)

在给定其泛型参数 TDataRow 的输入 DataTable 对象的情况下,将 IEnumerable<T> 对象复制到指定的 DataRowCopies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

Ancestors<T>(IEnumerable<T>)

返回元素集合,其中包含源集合中每个节点的上级。Returns a collection of elements that contains the ancestors of every node in the source collection.

Ancestors<T>(IEnumerable<T>, XName)

返回经过筛选的元素集合,其中包含源集合中每个节点的上级。Returns a filtered collection of elements that contains the ancestors of every node in the source collection. 集合中仅包括具有匹配 XName 的元素。Only elements that have a matching XName are included in the collection.

DescendantNodes<T>(IEnumerable<T>)

返回源集合中每个文档和元素的子代节点的集合。Returns a collection of the descendant nodes of every document and element in the source collection.

Descendants<T>(IEnumerable<T>)

返回元素集合,其中包含源集合中每个元素和文档的子代元素。Returns a collection of elements that contains the descendant elements of every element and document in the source collection.

Descendants<T>(IEnumerable<T>, XName)

返回经过筛选的元素集合,其中包含源集合中每个元素和文档的子代元素。Returns a filtered collection of elements that contains the descendant elements of every element and document in the source collection. 集合中仅包括具有匹配 XName 的元素。Only elements that have a matching XName are included in the collection.

Elements<T>(IEnumerable<T>)

返回源集合中每个元素和文档的子元素的集合。Returns a collection of the child elements of every element and document in the source collection.

Elements<T>(IEnumerable<T>, XName)

返回源集合中经过筛选的每个元素和文档的子元素集合。Returns a filtered collection of the child elements of every element and document in the source collection. 集合中仅包括具有匹配 XName 的元素。Only elements that have a matching XName are included in the collection.

InDocumentOrder<T>(IEnumerable<T>)

返回节点集合(其中包含源集合中的所有节点),并按文档顺序排列。Returns a collection of nodes that contains all nodes in the source collection, sorted in document order.

Nodes<T>(IEnumerable<T>)

返回源集合中每个文档和元素的子节点集合。Returns a collection of the child nodes of every document and element in the source collection.

Remove<T>(IEnumerable<T>)

将源集合中的每个节点从其父节点中移除。Removes every node in the source collection from its parent node.

适用于