共用方式為


NamedPipeTransportBindingElement.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

成員,用來描述建立通道處理站時所需的繫結、行為、合約及其他資訊。

傳回

傳回指定型別的通道處理站。

例外狀況

context 不可以是 null

傳遞了無效的引數。

範例

這個範例會說明如何建立指定型別的通道處理站,以用來建立通道:

BindingContext bContext = new BindingContext(customBinding, bpCollection);
IChannelFactory<IOutputChannel> factory =
    binding.BuildChannelFactory<IOutputChannel>(bContext);
Dim bContext As New BindingContext(customBinding, bpCollection)
Dim factory As IChannelFactory(Of IOutputChannel) = binding.BuildChannelFactory(Of IOutputChannel)(bContext)

備註

這個方法可以用來建立特定型別的通道處理站 Factory,以便依據傳輸繫結項目的組態傳送訊息。

適用於