BindingElement.CanBuildChannelFactory(Of TChannel) Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Returns a value that indicates whether the binding element can build a channel factory for a specific type of channel.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
'Declaration Public Overridable Function CanBuildChannelFactory(Of TChannel) ( _ context As BindingContext _ ) As Boolean
Type Parameters
- TChannel
The type of channel the channel factory produces.
Parameters
- context
- Type: System.ServiceModel.Channels.BindingContext
The BindingContext that provides context for the binding element.
Return Value
Type: System.Booleantrue if the IChannelFactory(Of TChannel) of type TChannel can be built by the binding element; otherwise, false.
| Exception | Condition |
|---|---|
| ArgumentNullException | context is Nothing. |
Use this method if you want to check that the channel factory for channels of type TChannel can be build for the context provided before attempting to build the factory. Alternatively, build the channel factory by calling BuildChannelFactory(Of TChannel) and catch the exception generated if it cannot be built.