Compartilhar via


MailTransportBindingElementBase.BuildChannelListener<TChannel> Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Initializes a channel listener for accepting channels of a specified type from the binding context.

Namespace:  Microsoft.ServiceModel.Channels.Mail
Assembly:  Microsoft.ServiceModel.Channels.Mail (in Microsoft.ServiceModel.Channels.Mail.dll)

Syntax

'Declaration
Public Overrides Function BuildChannelListener(Of TChannel As {Class, IChannel}) ( _
    context As BindingContext _
) As IChannelListener(Of TChannel)
'Usage
Dim instance As MailTransportBindingElementBase
Dim context As BindingContext
Dim returnValue As IChannelListener(Of TChannel)

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

Type Parameters

  • TChannel
    The type of channel factory. You must specify IInputChannel.

Parameters

Return Value

Type: System.ServiceModel.Channels.IChannelListener<TChannel>
The IChannelListener object of type IInputChannel that is initialized from the context.

Exceptions

Exception Condition
ArgumentException

Tchannel is not of type IInputChannel.

ArgumentNullException

The Transport property is nulla null reference (Nothing in Visual Basic).

Remarks

Do not call this method directly unless you create a BindingContext object. Instead, when you create a channel listener for a mail binding, use a version of the BuildChannelListener<TChannel> method that takes a Uri as one of its arguments. If a Uri is not passed in the call to BuildChannelListener<TChannel>, an ArgumentException is thrown.

You can use the BuildChannelListener<TChannel> method to obtain a channel listener for receiving messages based on the configuration of the transport binding element. Use the returned IChannelListener object to call the AcceptChannel method.

.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