MsmqTransportBindingElement.CanBuildChannelFactory<TChannel> 方法

定義

傳回布林值,這個值會指出您是否可以使用所提供的內容來建置通道處理站。

public:
generic <typename TChannel>
 override bool CanBuildChannelFactory(System::ServiceModel::Channels::BindingContext ^ context);
public override bool CanBuildChannelFactory<TChannel> (System.ServiceModel.Channels.BindingContext context);
override this.CanBuildChannelFactory : System.ServiceModel.Channels.BindingContext -> bool
Public Overrides Function CanBuildChannelFactory(Of TChannel) (context As BindingContext) As Boolean

類型參數

TChannel

要用於建置通道接聽程式的通道型別。 允許的通道型別為 IOutputSessionChannelIOutputChannel 類別。

參數

context
BindingContext

用來建置通道處理站的 BindingContext

傳回

Boolean

如果可以使用所提供的內容來建置通道處理站,則為 true,否則為 false。 只有當 trueTChannelIOutputChannel 時,此繫結項目才會傳回 IOutputSessionChannel

範例

if (transportBindingElement.CanBuildChannelFactory<IOutputChannel>(context))
{
    // Do something...
}

適用於