MsmqTransportBindingElement.CanBuildChannelFactory<TChannel>(BindingContext) 方法

定义

返回一个布尔值,该值指示是否能够使用提供的上下文生成通道工厂。Returns a Boolean value that indicates whether you can build a channel factory with the context provided.

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

用于生成通道侦听器的通道类型。The channel type to be used to build the channel listener. 允许使用的通道类型为 IOutputSessionChannelIOutputChannel 类。Permitted channel types are IOutputSessionChannel or a IOutputChannel class.

参数

context
BindingContext

用以生成通道工厂的 BindingContextThe BindingContext with which to build the channel factory.

返回

Boolean

如果利用所提供的上下文可生成通道工厂,则为 true;否则为 falsetrue if you can build a channel factory with the context provided; otherwise, false. 仅当 trueTChannelIOutputChannel 时,绑定元素才返回 IOutputSessionChannelThe binding element returns true only when TChannel is IOutputChannel or IOutputSessionChannel.

示例

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

适用于