TransactionFlowBindingElement.BuildChannelListener<TChannel> 方法

定义

初始化通道侦听器,用于接受绑定上下文中指定类型的通道。

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

类型参数

TChannel

通道类型。

参数

context
BindingContext

应该用于生成通道侦听器的 BindingContext

返回

IChannelListener<TChannel>

IChannelListener<TChannel> 类型的 TChannel(从 context 中初始化)。

例外

contextnull

无法生成指定通道类型的通道侦听器。

注解

此方法创建一个通道侦听器来接收此绑定的消息。

创建通道时,基础架构会调用此方法。 只有实现自定义绑定元素时,才将它用于您的代码中。

适用于