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

정의

바인딩 요소에서 특정 채널 형식에 대한 수신기를 만들 수 있는지 여부를 나타내는 값을 반환합니다.

public:
generic <typename TChannel>
 where TChannel : class, System::ServiceModel::Channels::IChannel virtual bool CanBuildChannelListener(System::ServiceModel::Channels::BindingContext ^ context);
public virtual bool CanBuildChannelListener<TChannel> (System.ServiceModel.Channels.BindingContext context) where TChannel : class, System.ServiceModel.Channels.IChannel;
abstract member CanBuildChannelListener : System.ServiceModel.Channels.BindingContext -> bool (requires 'Channel : null and 'Channel :> System.ServiceModel.Channels.IChannel)
override this.CanBuildChannelListener : System.ServiceModel.Channels.BindingContext -> bool (requires 'Channel : null and 'Channel :> System.ServiceModel.Channels.IChannel)
Public Overridable Function CanBuildChannelListener(Of TChannel As {Class, IChannel}) (context As BindingContext) As Boolean

형식 매개 변수

TChannel

수신기가 수락하는 채널의 형식입니다.

매개 변수

context
BindingContext

바인딩 요소의 컨텍스트를 제공하는 BindingContext입니다.

반환

Boolean

바인딩 요소에서 true 형식의 IChannelListener<TChannel>를 만들 수 있으면 IChannel이고, 그렇지 않으면 false입니다.

예외

context이(가) null인 경우

예제

CustomBinding binding = new CustomBinding();
HttpTransportBindingElement element = new HttpTransportBindingElement();
BindingParameterCollection parameters = new BindingParameterCollection();
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);

bool bFlag = element.CanBuildChannelListener<IReplyChannel>(context);

설명

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

적용 대상