DiscoveryClientBindingElement.CanBuildChannelListener<TChannel>(BindingContext) 方法
定义
因为 Discovery 客户端通道不支持生成通道侦听器,所以此方法总是返回 false。Because building a channel listener is not supported by the Discovery client channel, this method always returns false. 可以对此方法进行扩展以返回一个值,用于指示绑定元素是否可以为特定类型的通道生成侦听器。It may be extended to return a value that indicates whether the binding element can build a listener for a specific type of channel.
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
侦听器接受的通道类型。The type of channel the listener accepts.
参数
- context
- BindingContext
绑定上下文。The binding context.
返回
如果绑定元素可以生成指定类型的 IChannelListener<TChannel>,则为 true;否则为 false。true if the IChannelListener<TChannel> of the specified type can be built by the binding element, otherwise false.