語言

TcpTransportBindingElement.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

若未找到該物件,則由指定物件 BindingContextnull , 或 。

範例

以下範例說明如何從 BindingContext取得指定物件。

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

bool SupportsServerAuthentication =
    b.SupportsServerAuthentication;

備註

此方法從基底類別取得指定物件,或該類別的祖先之一。 回傳的物件通常是一組屬性,例如,一個實 ISecurityCapabilities作 的物件。

適用於