MailTransportBindingElementBase.CanBuildChannelFactory<TChannel> Method
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Returns a value that indicates whether the binding element can build a channel factory for a specific type of channel.
Namespace: Microsoft.ServiceModel.Channels.Mail
Assembly: Microsoft.ServiceModel.Channels.Mail (in Microsoft.ServiceModel.Channels.Mail.dll)
Syntax
'Declaration
Public Overrides Function CanBuildChannelFactory(Of TChannel) ( _
context As BindingContext _
) As Boolean
'Usage
Dim instance As MailTransportBindingElementBase
Dim context As BindingContext
Dim returnValue As Boolean
returnValue = instance.CanBuildChannelFactory(context)
public override bool CanBuildChannelFactory<TChannel>(
BindingContext context
)
public:
generic<typename TChannel>
virtual bool CanBuildChannelFactory(
BindingContext^ context
) override
abstract CanBuildChannelFactory :
context:BindingContext -> bool
override CanBuildChannelFactory :
context:BindingContext -> bool
Type Parameters
- TChannel
The type of channel. You must specify IOutputChannel.
Parameters
- context
Type: System.ServiceModel.Channels.BindingContext
Bindings, behavior, contracts, and other information that is required to create the channel factory.
Return Value
Type: System.Boolean
true if the IChannelFactory object of type IOutputChannel can be built by the binding element; otherwise, false.
Remarks
Do not call this method directly unless you create a BindingContext object. Instead, use a version of the CanBuildChannelFactory<TChannel> method that takes a BindingParameterCollection object as a parameter.
Use this method if you want to check that the channel factory for channels of type TChannel can be built for the binding parameters specified before you try to actually build the factory. Alternatively, try to build the channel factory by calling the BuildChannelFactory<TChannel> method, and catch the exception that is generated if the channel factory cannot be built.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Platforms
Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information
.NET Compact Framework
Supported in: 3.5
See Also
Reference
MailTransportBindingElementBase Class