BindingContext.CanBuildInnerChannelFactory<TChannel> 方法

定义

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

public:
generic <typename TChannel>
 bool CanBuildInnerChannelFactory();
public bool CanBuildInnerChannelFactory<TChannel> ();
member this.CanBuildInnerChannelFactory : unit -> bool
Public Function CanBuildInnerChannelFactory(Of TChannel) () As Boolean

类型参数

TChannel

内部通道工厂生成的 IChannel 对象的类型。

返回

如果内部通道工厂可以生成指定的 true,则为 TChannel;否则为 false

示例

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

适用于