BindingElement.CanBuildChannelFactory<TChannel>(BindingContext) 메서드

정의

바인딩 요소가 특정 유형의 채널에 대한 채널 팩터리를 빌드할 수 있는지 여부를 나타내는 값을 반환합니다.

public:
generic <typename TChannel>
 virtual bool CanBuildChannelFactory(System::ServiceModel::Channels::BindingContext ^ context);
public virtual bool CanBuildChannelFactory<TChannel>(System.ServiceModel.Channels.BindingContext context);
abstract member CanBuildChannelFactory : System.ServiceModel.Channels.BindingContext -> bool
override this.CanBuildChannelFactory : System.ServiceModel.Channels.BindingContext -> bool
Public Overridable Function CanBuildChannelFactory(Of TChannel) (context As BindingContext) As Boolean

형식 매개 변수

TChannel

채널 팩터리에서 생성하는 채널의 유형입니다.

매개 변수

context
BindingContext

BindingContext 바인딩 요소에 대한 컨텍스트를 제공하는 항목입니다.

반품

true바인딩 요소에서 형식 IChannelFactory<TChannel>TChannel 빌드할 수 있으면 이고, false그렇지 않으면 .

예외

contextnull입니다.

예제

CustomBinding binding = new CustomBinding();
HttpTransportBindingElement element = new HttpTransportBindingElement();
BindingParameterCollection parameters = new BindingParameterCollection();
BindingContext context = new BindingContext(binding, parameters);

bool bFlag = element.CanBuildChannelFactory<IRequestChannel>(context);

설명

팩터리를 빌드하기 전에 제공된 형식의 TChannel 채널에 대한 채널 팩터리를 빌드 context 할 수 있는지 확인하려면 이 메서드를 사용합니다. 또는 호출 BuildChannelFactory 하여 채널 팩터리를 빌드하고 생성할 수 없는 경우 생성된 예외를 catch합니다.

적용 대상