共用方式為


MailTransportBindingElementBase.BuildChannelFactory<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 factory for producing 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 BuildChannelFactory(Of TChannel) ( _
    context As BindingContext _
) As IChannelFactory(Of TChannel)
'Usage
Dim instance As MailTransportBindingElementBase
Dim context As BindingContext
Dim returnValue As IChannelFactory(Of TChannel)

returnValue = instance.BuildChannelFactory(context)
public override IChannelFactory<TChannel> BuildChannelFactory<TChannel>(
    BindingContext context
)
public:
generic<typename TChannel>
virtual IChannelFactory<TChannel>^ BuildChannelFactory(
    BindingContext^ context
) override
abstract BuildChannelFactory : 
        context:BindingContext -> IChannelFactory<'TChannel> 
override BuildChannelFactory : 
        context:BindingContext -> IChannelFactory<'TChannel> 

Type Parameters

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

Parameters

Return Value

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

Exceptions

Exception Condition
ArgumentException

TChannel is not of type IOutputChannel.

ArgumentNullException

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

Remarks

Do not call this method directly unless you create a new BindingContext object. Instead, when you create a channel factory for a mail binding, use a version of the BuildChannelFactory<TChannel> method that takes a BindingParameterCollection object as a parameter.

You can use BuildChannelFactory<TChannel> to obtain a channel factory for sending messages based on the configuration of the transport binding element. Use the returned IChannelFactory object to call the Open method, and then call the CreateChannel 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