Share via


TransportBindingElement.GetProperty<T>(BindingContext) 方法

定义

从指定的 BindingContext 获取属性。

public:
generic <typename T>
 where T : class override T GetProperty(System::ServiceModel::Channels::BindingContext ^ context);
public override T GetProperty<T> (System.ServiceModel.Channels.BindingContext context) where T : class;
override this.GetProperty : System.ServiceModel.Channels.BindingContext -> 'T (requires 'T : null)
Public Overrides Function GetProperty(Of T As Class) (context As BindingContext) As T

类型参数

T

要获取的属性。

参数

context
BindingContext

一个 BindingContext

返回

T

取自指定 BindingContext 的属性。

注解

此方法接收绑定上下文作为输入参数,该参数表示绑定元素的堆栈。 此方法直接获取指定的对象,将查询向下委托给堆栈中的下一个绑定元素或这两个元素的组合。 如果此方法委托查询,则它可以修改上下文。 堆栈中的每个绑定元素在受到委托后都可以重复此过程,直到到达堆栈底部。 返回的对象通常是属性的集合。

如果 T 的类型为 ChannelProtectionRequirementsXmlDictionaryReaderQuotasMessageVersion,则返回此类的一个实例。 如果 T 的类型匹配 BindingParameters 中的实例的类型,则返回该实例。

此方法由绑定元素以及运行时对象(例如 IChannelFactoryIChannelListenerIChannel)实现。

适用于