MsmqTransportBindingElement.CanBuildChannelListener<TChannel> 方法

定义

返回一个布尔值,该值指示是否能够使用提供的上下文生成通道侦听器。

public:
generic <typename TChannel>
 where TChannel : class, System::ServiceModel::Channels::IChannel override bool CanBuildChannelListener(System::ServiceModel::Channels::BindingContext ^ context);
public override bool CanBuildChannelListener<TChannel> (System.ServiceModel.Channels.BindingContext context) where TChannel : class, System.ServiceModel.Channels.IChannel;
override this.CanBuildChannelListener : System.ServiceModel.Channels.BindingContext -> bool (requires 'Channel : null and 'Channel :> System.ServiceModel.Channels.IChannel)
Public Overrides Function CanBuildChannelListener(Of TChannel As {Class, IChannel}) (context As BindingContext) As Boolean

类型参数

TChannel

用于生成通道侦听器的通道类型。 允许使用的通道类型为 IInputSessionChannelIInputChannel 类。

参数

context
BindingContext

用以生成通道侦听器的 BindingContext

返回

如果利用所提供的上下文可生成通道侦听器,则为 true;否则为 false

仅当 trueTChannelIInputChannel 时,绑定元素才返回 IInputSessionChannel

示例

if (transportBindingElement.CanBuildChannelListener<IInputChannel>(context))
{
    // Do something...
}

适用于