共用方式為


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

要取得的物件。

參數

傳回

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 的物件。

適用於