Share via


MailTransportBindingElementBase.CanBuildChannelListener<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 listener 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 CanBuildChannelListener(Of TChannel As {Class, IChannel}) ( _
    context As BindingContext _
) As Boolean
'Usage
Dim instance As MailTransportBindingElementBase
Dim context As BindingContext
Dim returnValue As Boolean

returnValue = instance.CanBuildChannelListener(context)
public override bool CanBuildChannelListener<TChannel>(
    BindingContext context
)
where TChannel : class, IChannel
public:
generic<typename TChannel>
where TChannel : ref class, IChannel
virtual bool CanBuildChannelListener(
    BindingContext^ context
) override
abstract CanBuildChannelListener : 
        context:BindingContext -> bool  when 'TChannel : not struct and IChannel
override CanBuildChannelListener : 
        context:BindingContext -> bool  when 'TChannel : not struct and IChannel

Type Parameters

Parameters

Return Value

Type: System.Boolean
true if the IChannelListener object of type IInputChannel 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 CanBuildChannelListener<TChannel> method that takes a BindingParameterCollection object as a parameter.

Use this method if you want to check that the channel listener for channels of type TChannel can be built for the binding parameters specified before you try to actually build the listener. Alternatively, try to build the channel listener by calling a version of the BuildChannelListener<TChannel> method that takes a Uri as an argument, and catch the exception that is generated if the channel listener cannot be built.

.NET Framework Security

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

MailTransportBindingElementBase Members

Microsoft.ServiceModel.Channels.Mail Namespace