Binding.CanBuildChannelListener 方法

定義

傳回值,這個值指出目前的繫結是否可以在服務上建置滿足某個指定之準則的通道接聽程式堆疊。Returns a value that indicates whether the current binding can build a channel listener stack on the service that satisfies some specified criteria.

多載

CanBuildChannelListener<TChannel>(Object[])

傳回值,這個值指出目前的繫結是否可以在服務上建置滿足物件陣列中指定之準則的通道接聽程式堆疊。Returns a value that indicates whether the current binding can build a channel listener stack on the service that satisfies the criteria specified in an array of objects.

CanBuildChannelListener<TChannel>(BindingParameterCollection)

傳回值,這個值指出目前的繫結是否可以在服務上建置滿足指定之繫結參數集合的通道接聽程式堆疊。Returns a value that indicates whether the current binding can build a channel listener stack on the service that satisfies the collection of binding parameters specified.

CanBuildChannelListener<TChannel>(Object[])

傳回值,這個值指出目前的繫結是否可以在服務上建置滿足物件陣列中指定之準則的通道接聽程式堆疊。Returns a value that indicates whether the current binding can build a channel listener stack on the service that satisfies the criteria specified in an array of objects.

public:
generic <typename TChannel>
 where TChannel : class, System::ServiceModel::Channels::IChannel bool CanBuildChannelListener(... cli::array <System::Object ^> ^ parameters);
public bool CanBuildChannelListener<TChannel> (params object[] parameters) where TChannel : class, System.ServiceModel.Channels.IChannel;
member this.CanBuildChannelListener : obj[] -> bool (requires 'Channel : null and 'Channel :> System.ServiceModel.Channels.IChannel)
Public Function CanBuildChannelListener(Of TChannel As {Class, IChannel}) (ParamArray parameters As Object()) As Boolean

類型參數

TChannel

正在測試之接聽程式所針對的通道型別。The type of channel for which the listener is being tested.

參數

parameters
Object[]

物件陣列,可指定所建置之通道處理站的需求。The object array that specifies requirements for the channel factory that is built.

傳回

Boolean

如果可以在服務上建置指定的通道接聽程式堆疊則為 true,否則為 falsetrue if the specified channel listener stack can be build on the service; otherwise, false.

備註

如果您想要檢查,TChannel 型別之通道的通道接聽程式可以在嘗試實際建置接聽程式之前,針對指定的 parameters 繫結進行建置,請使用這個方法。Use this method if you want to check that the channel listener for channels of type TChannel can be build for the binding parameters specified before attempting to actually build the listener. 或者,請嘗試呼叫 BuildChannelListener<TChannel>(Object[]) 來建置通道接聽程式並攔截產生的例外狀況 (如果無法建置的話)。Alternatively, try to build the channel listener by calling BuildChannelListener<TChannel>(Object[]) and catch the exception generated if it cannot be built.

適用於

CanBuildChannelListener<TChannel>(BindingParameterCollection)

傳回值,這個值指出目前的繫結是否可以在服務上建置滿足指定之繫結參數集合的通道接聽程式堆疊。Returns a value that indicates whether the current binding can build a channel listener stack on the service that satisfies the collection of binding parameters specified.

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

類型參數

TChannel

正在測試之接聽程式所針對的通道型別。The type of channel for which the listener is being tested.

參數

parameters
BindingParameterCollection

指定所建置之通道接聽程式需求的 BindingParameterCollectionThe BindingParameterCollection that specifies requirements for the channel listener that is built.

傳回

Boolean

如果可以在服務上建置指定的通道接聽程式堆疊則為 true,否則為 falsetrue if the specified channel listener stack can be build on the service; otherwise, false.

備註

如果您想要檢查,TChannel 型別之通道的通道接聽程式可以在嘗試實際建置接聽程式之前,針對指定的 parameters 繫結進行建置,請使用這個方法。Use this method if you want to check that the channel listener for channels of type TChannel can be build for the binding parameters specified before attempting to actually build the listener. 或者,請嘗試呼叫 BuildChannelListener<TChannel>(BindingParameterCollection) 來建置通道接聽程式並攔截產生的例外狀況 (如果無法建置的話)。Alternatively, try to build the channel listener by calling BuildChannelListener<TChannel>(BindingParameterCollection) and catch the exception generated if it cannot be built.

適用於