共用方式為


BinaryMessageEncodingBindingElement.BuildChannelFactory<TChannel> 方法

定義

在用戶端上建置通道處理站堆疊,這個堆疊會針對指定的內容建立指定的通道類型。

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

通道處理站所產生之通道的類型。

參數

context
BindingContext

通道的 BindingContext

傳回

IChannelFactory<TChannel> 型別的 TChannel,其適用於指定的內容。

範例

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)

適用於