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시 이 메서드의 요구 사항이 있는 인스턴스를 반환 ChannelProtectionRequirements 해야 합니다.

적용 대상