TransactionFlowBindingElement.CanBuildChannelListener<TChannel> 方法

定義

傳回值,這個值會指出指定的繫結內容是否可以建置通道接聽程式,以接受指定之型別的通道。

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

類型參數

TChannel

通道型別。

參數

context
BindingContext

應該用來判斷是否能夠建置通道接聽程式的 BindingContext

傳回

如果能夠從 true 建置指定通道類型的通道接聽程式,則為 context,否則為 false

例外狀況

contextnull

備註

在嘗試實際建置接聽程式之前,您應該呼叫這個方法檢查是否能夠建置指定 TChannelcontext 通道類型的通道接聽程式。 請注意,如果無法建置指定通道型別的通道接聽程式,BuildChannelListener 就會擲回例外狀況。

適用於