BindingContext.CanBuildInnerChannelListener<TChannel> 方法

定义

返回一个值,该值指示是否可以生成内部通道侦听器来侦听指定类型的通道。

public:
generic <typename TChannel>
 where TChannel : class, System::ServiceModel::Channels::IChannel bool CanBuildInnerChannelListener();
public bool CanBuildInnerChannelListener<TChannel> () where TChannel : class, System.ServiceModel.Channels.IChannel;
member this.CanBuildInnerChannelListener : unit -> bool (requires 'Channel : null and 'Channel :> System.ServiceModel.Channels.IChannel)
Public Function CanBuildInnerChannelListener(Of TChannel As {Class, IChannel}) () As Boolean

类型参数

TChannel

内部通道侦听器侦听的 IChannel 对象的类型。

返回

如果可以生成用于侦听指定 true 的内部通道侦听器,则为 TChannel;否则为 false

示例

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

适用于