TcpTransportBindingElement.GetProperty<T>(BindingContext) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
從 中取得指定的物件 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
傳回
T
若未找到該物件,則由指定物件 BindingContextnull , 或 。
範例
以下範例說明如何從 BindingContext取得指定物件。
BasicHttpBinding binding = new BasicHttpBinding();
ISecurityCapabilities b =
binding.GetProperty<ISecurityCapabilities>
(new BindingParameterCollection());
bool SupportsServerAuthentication =
b.SupportsServerAuthentication;
備註
此方法從基底類別取得指定物件,或該類別的祖先之一。 回傳的物件通常是一組屬性,例如,一個實 ISecurityCapabilities作 的物件。