Share via


BindingElement.GetProperty<T>(BindingContext) 메서드

정의

파생 클래스에서 재정의되는 경우 요청한 형식화된 개체가 있으면 바인딩 스택의 해당 계층에서 반환합니다.

public:
generic <typename T>
 where T : class abstract T GetProperty(System::ServiceModel::Channels::BindingContext ^ context);
public abstract T GetProperty<T> (System.ServiceModel.Channels.BindingContext context) where T : class;
abstract member GetProperty : System.ServiceModel.Channels.BindingContext -> 'T (requires 'T : null)
Public MustOverride Function GetProperty(Of T As Class) (context As BindingContext) As T

형식 매개 변수

T

메서드에서 쿼리하고 있는 형식화된 개체입니다.

매개 변수

context
BindingContext

바인딩 요소의 BindingContext입니다.

반환

T

요청한 형식화된 개체 T가 있으면 해당 개체이고, 그렇지 않으면 null입니다.

예제

CustomBinding binding = new CustomBinding();
HttpTransportBindingElement element = new HttpTransportBindingElement();
BindingParameterCollection parameters = new BindingParameterCollection();
parameters.Add(new ServiceCredentials());
Uri baseAddress = new Uri("http://localhost:8000/ChannelApp");
String relAddress = "http://localhost:8000/ChannelApp/service";
BindingContext context = new BindingContext(binding, parameters, baseAddress, relAddress, ListenUriMode.Explicit);

ServiceCredentials serviceCredentials = element.GetProperty<ServiceCredentials>(context);

설명

이를 사용하여 바인딩 요소 스택에서 기능, 요구 사항 및 매개 변수를 검색합니다. 바인딩 요소가 요청된 개체의 반환을 지원하면 해당 개체를 반환합니다. 그렇지 않으면 스택의 다음 바인딩 요소에 호출을 위임합니다. 스택의 맨 아래에 도달하고 요청된 개체를 지원하는 바인딩 요소가 없는 경우 메서드는 를 반환합니다 null.

참고

암호화해야 하는 메시지 헤더를 추가하는 경우 를 요청할 ChannelProtectionRequirements때 이 메서드의 요구 사항이 포함된 instance 반환 ChannelProtectionRequirements 해야 합니다.

적용 대상