XPathMessageFilterTable<TFilterData>.Add 方法

定义

XPathMessageFilter 及其关联的 FilterData 添加到 XPathMessageFilterTable<TFilterData>Adds an XPathMessageFilter and its associated FilterData to the XPathMessageFilterTable<TFilterData>.

重载

Add(KeyValuePair<MessageFilter,TFilterData>)

将 filter/FilterData(键/值)对添加到 XPathMessageFilterTable<TFilterData>Adds a filter/FilterData (key/value) pair to the XPathMessageFilterTable<TFilterData>.

Add(MessageFilter, TFilterData)

将筛选器/数据对添加到筛选器表中。Adds a filter/data pair to the filter table.

Add(XPathMessageFilter, TFilterData)

将筛选器/数据对添加到筛选器表中。Adds a filter/data pair to the filter table.

Add(KeyValuePair<MessageFilter,TFilterData>)

将 filter/FilterData(键/值)对添加到 XPathMessageFilterTable<TFilterData>Adds a filter/FilterData (key/value) pair to the XPathMessageFilterTable<TFilterData>.

public:
 virtual void Add(System::Collections::Generic::KeyValuePair<System::ServiceModel::Dispatcher::MessageFilter ^, TFilterData> item);
public void Add (System.Collections.Generic.KeyValuePair<System.ServiceModel.Dispatcher.MessageFilter,TFilterData> item);
abstract member Add : System.Collections.Generic.KeyValuePair<System.ServiceModel.Dispatcher.MessageFilter, 'FilterData> -> unit
override this.Add : System.Collections.Generic.KeyValuePair<System.ServiceModel.Dispatcher.MessageFilter, 'FilterData> -> unit
Public Sub Add (item As KeyValuePair(Of MessageFilter, TFilterData))

参数

item
KeyValuePair<MessageFilter,TFilterData>

要添加到表中的 KeyValuePair<TKey,TValue> <Filter, FilterData>。The KeyValuePair<TKey,TValue> <Filter, FilterData> to add to the table.

实现

异常

filternullfilter is null.

发生了编译器错误。A compiler error occurred.

注解

此方法实现 Add 类的 ICollection<T> 方法。This method implements the Add method of the ICollection<T> class. 使用强类型重载 filter 可避免将 MessageFilter 参数从类型 XPathMessageFilter 隐式转换为 AddThe implicit conversion of the filter parameter from type MessageFilter to the XPathMessageFilter can be avoided by using the strongly-typed overload, Add.

Add(MessageFilter, TFilterData)

将筛选器/数据对添加到筛选器表中。Adds a filter/data pair to the filter table.

public:
 virtual void Add(System::ServiceModel::Dispatcher::MessageFilter ^ filter, TFilterData data);
public void Add (System.ServiceModel.Dispatcher.MessageFilter filter, TFilterData data);
abstract member Add : System.ServiceModel.Dispatcher.MessageFilter * 'FilterData -> unit
override this.Add : System.ServiceModel.Dispatcher.MessageFilter * 'FilterData -> unit
Public Sub Add (filter As MessageFilter, data As TFilterData)

参数

filter
MessageFilter

用作所添加对的键的 MessageFilterThe MessageFilter used as the key of the pair added. 必须为 XPathMessageFilter 的实例。Must be an instance of XPathMessageFilter.

data
TFilterData

与筛选器关联的、用作所添加对的值的 FilterDataThe FilterData associated with the filter used as the value of the pair added.

实现

异常

filternullfilter is null.

filter 不是 XPathMessageFilterfilter is not an XPathMessageFilter.

发生了编译器错误。A compiler error occurred.

注解

使用强类型重载 filter 可避免将 MessageFilter 参数从 XPathMessageFilter 内部转换为 AddThe internal conversion of the filter parameter from MessageFilter to the XPathMessageFilter can be avoided by using the strongly-typed overload, Add.

Add(XPathMessageFilter, TFilterData)

将筛选器/数据对添加到筛选器表中。Adds a filter/data pair to the filter table.

public:
 void Add(System::ServiceModel::Dispatcher::XPathMessageFilter ^ filter, TFilterData data);
public void Add (System.ServiceModel.Dispatcher.XPathMessageFilter filter, TFilterData data);
member this.Add : System.ServiceModel.Dispatcher.XPathMessageFilter * 'FilterData -> unit
Public Sub Add (filter As XPathMessageFilter, data As TFilterData)

参数

filter
XPathMessageFilter

用作所添加对的键的 XPathMessageFilterThe XPathMessageFilter used as the key of the pair added.

data
TFilterData

与筛选器关联的、用作所添加对的值的 FilterDataThe FilterData associated with the filter; used as the value of the pair added.

异常

filternullfilter is null.

发生了编译器错误。A compiler error occurred.

注解

这可提供强类型重载以将 XPathMessageFilter 添加到筛选器表,强类型重载比弱类型重载执行的更好,因为强类型重载可避免将 filter 参数从类型 MessageFilter 隐式转换为 XPathMessageFilterThis provides a strongly-typed overload for adding an XPathMessageFilter to the filter table that performs better than the weakly-typed overload because it avoids implicit conversion of the filter parameter from type MessageFilter to the XPathMessageFilter.

适用于