IMessageFilterTable<TFilterData>.GetMatchingFilter IMessageFilterTable<TFilterData>.GetMatchingFilter IMessageFilterTable<TFilterData>.GetMatchingFilter IMessageFilterTable<TFilterData>.GetMatchingFilter Method

定义

从表中返回指定的消息或缓冲消息满足其查询条件的筛选器。Returns a filter from the table whose query criteria are satisfied by a specified message or buffered message.

重载

GetMatchingFilter(Message, MessageFilter) GetMatchingFilter(Message, MessageFilter) 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) GetMatchingFilter(MessageBuffer, MessageFilter) GetMatchingFilter(MessageBuffer, MessageFilter) 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 or buffered message, and returns that filter in an out parameter.

注解

当预期会有单个筛选器与消息相匹配,并且需要匹配筛选器时,请使用此方法。Use this method when a single filter is expected to match the message and the matching filter is required.

如果不需要检查正文内容,请使用 GetMatchingFilterUse GetMatchingFilter if the body content does not require examination. 如果可能需要检查消息正文的内容,请使用 GetMatchingFilterUse GetMatchingFilter if the contents of the message body may require examination.

GetMatchingFilter(Message, MessageFilter) GetMatchingFilter(Message, MessageFilter) 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.

public:
 bool GetMatchingFilter(System::ServiceModel::Channels::Message ^ message, [Runtime::InteropServices::Out] System::ServiceModel::Dispatcher::MessageFilter ^ % result);
public bool GetMatchingFilter (System.ServiceModel.Channels.Message message, out System.ServiceModel.Dispatcher.MessageFilter result);
abstract member GetMatchingFilter : System.ServiceModel.Channels.Message * MessageFilter -> bool

参数

message
Message Message Message Message

要测试的 MessageThe Message to test.

filter
MessageFilter MessageFilter MessageFilter MessageFilter

存储 message 符合的筛选器的 out 参数。out parameter that stores the filter that is satisfied by the message. 如果找不到筛选器,该参数将设置为默认值。If no filter was found, the parameter is set to its default value.

返回

如果 message 满足表中至少一个筛选器的匹配条件,则为 true;如果不满足任何筛选器,则为 falsetrue if the match criterion of at least one filter in the table is satisfied by message; false if no filter is satisfied.

注解

当预期会有单个筛选器与消息相匹配,并且需要匹配筛选器时,请使用此方法。Use this method when a single filter is expected to match the message and the matching filter is required.

如果必须由筛选器表中的筛选器来检查消息的正文,请使用该方法的 GetMatchingFilter 版本。If the body of the message must be inspected by a filter in the filter table, use the GetMatchingFilter version of the method.

实施者说明

如果多个筛选器与消息相匹配,则必须引发 MultipleFilterMatchesExceptionIf more than one filter matches the message, a MultipleFilterMatchesException must be thrown.

此版本使用 Message,如果它试图检查消息正文,则必须引发 InvalidBodyAccessExceptionThis version takes a Message and must throw an InvalidBodyAccessException if it tries to examine the message body.

GetMatchingFilter(MessageBuffer, MessageFilter) GetMatchingFilter(MessageBuffer, MessageFilter) GetMatchingFilter(MessageBuffer, MessageFilter) 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 or buffered message, and returns that filter in an out parameter.

public:
 bool GetMatchingFilter(System::ServiceModel::Channels::MessageBuffer ^ buffer, [Runtime::InteropServices::Out] System::ServiceModel::Dispatcher::MessageFilter ^ % result);
public bool GetMatchingFilter (System.ServiceModel.Channels.MessageBuffer buffer, out System.ServiceModel.Dispatcher.MessageFilter result);
abstract member GetMatchingFilter : System.ServiceModel.Channels.MessageBuffer * MessageFilter -> bool
Public Function GetMatchingFilter (buffer As MessageBuffer, ByRef result As MessageFilter) As Boolean

参数

filter
MessageFilter MessageFilter MessageFilter MessageFilter

存储 message 符合的筛选器的 out 参数。out parameter that stores the filter that is satisfied by the message. 如果找不到筛选器,该参数将设置为默认值。If no filter was found, the parameter is set to its default value.

返回

如果 messageBuffer 满足表中至少一个筛选器的匹配条件,则为 true;如果不满足任何筛选器,则为 falsetrue if the match criterion of at least one filter in the table is satisfied by messageBuffer; false if no filter is satisfied.

注解

当预期会有单个筛选器与缓冲消息相匹配,同时必须返回匹配筛选器,且可能必须检查消息的正文时,请使用此方法。Use this method when a single filter is expected to match the buffered message, the matching filter must be returned, and the body of the message may have to be inspected.

适用于