MessageEncodingBindingElement.GetProperty<T>(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

요청한 형식의 개체가 있으면 해당 형식의 개체 T이고, 없으면 null입니다.

예외

context이(가) null인 경우

예제

다음 코드에서는 메서드를 구현하는 방법을 보여 줍니다 GetProperty<T>(BindingContext) .

public override T GetProperty<T>(BindingContext context)
{
    if (typeof(T) == typeof(XmlDictionaryReaderQuotas))
    {
        return (T)(object)this.readerQuotas;
    }
    else
    {
        return base.GetProperty<T>(context);
    }
}

설명

이를 사용하여 속성을 검색하거나 채널 스택의 적절한 계층에서 상태를 가져오기 위한 인터페이스와 같은 형식화된 개체를 요청합니다. 요청된 개체의 반환을 지원하는 계층이 있으면 해당 개체가 반환됩니다. 그렇지 않으면 스택의 다음 계층에 호출을 위임합니다. 스택의 맨 아래에 도달할 때까지 요청된 개체를 지원하는 채널 계층이 없으면 메서드는 null을 반환합니다.

적용 대상