BinaryMessageEncodingBindingElement.BuildChannelFactory<TChannel>(BindingContext) 方法

定义

在客户端上生成通道工厂堆栈,该通道工厂堆栈可为指定上下文创建指定类型的通道。Builds the channel factory stack on the client that creates a specified type of channel for a specified context.

public:
generic <typename TChannel>
 override System::ServiceModel::Channels::IChannelFactory<TChannel> ^ BuildChannelFactory(System::ServiceModel::Channels::BindingContext ^ context);
public override System.ServiceModel.Channels.IChannelFactory<TChannel> BuildChannelFactory<TChannel> (System.ServiceModel.Channels.BindingContext context);
override this.BuildChannelFactory : System.ServiceModel.Channels.BindingContext -> System.ServiceModel.Channels.IChannelFactory<'Channel>
Public Overrides Function BuildChannelFactory(Of TChannel) (context As BindingContext) As IChannelFactory(Of TChannel)

类型参数

TChannel

通道工厂生成的通道类型。The type of channel the channel factory produces.

参数

context
BindingContext

通道的 BindingContextThe BindingContext for the channel.

返回

IChannelFactory<TChannel>

指定上下文的 IChannelFactory<TChannel> 类型的 TChannelAn IChannelFactory<TChannel> of type TChannel for the specified context.

示例

var binding = new CustomBinding();
var bpCol = new BindingParameterCollection();
var context = new BindingContext(binding, bpCol);
be.BuildChannelFactory<IDuplexChannel>(context);
Dim binding As New CustomBinding()
Dim bpCol As New BindingParameterCollection()
Dim context As New BindingContext(binding, bpCol)
be.BuildChannelFactory(Of IDuplexChannel)(context)

适用于