NamedPipeTransportBindingElement.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 中的指定对象;如果找不到该对象,则为 null

示例

此示例演示如何从 BindingContext 获取指定的对象:

BasicHttpBinding binding = new BasicHttpBinding();
ISecurityCapabilities b =
    binding.GetProperty<ISecurityCapabilities>
    (new BindingParameterCollection());

bool SupportsServerAuthentication =
    b.SupportsServerAuthentication;
Dim binding As New BasicHttpBinding()
Dim b As ISecurityCapabilities = binding.GetProperty(Of ISecurityCapabilities)(New BindingParameterCollection())

Dim SupportsServerAuthentication As Boolean = b.SupportsServerAuthentication

注解

此方法从基类或该类的一个上级中获取指定对象。 返回的对象通常是一个属性集合,例如实现 ISecurityCapabilities 的对象。

适用于