IChannelFactory<TChannel> 介面

定義

定義必須由通道處理站實作的介面 (該處理站會建立型別特有的通道)。Defines the interface that must be implemented by channel factories that create type-specific channels.

generic <typename TChannel>
public interface class IChannelFactory : System::ServiceModel::Channels::IChannelFactory
public interface IChannelFactory<TChannel> : System.ServiceModel.Channels.IChannelFactory
type IChannelFactory<'Channel> = interface
    interface IChannelFactory
    interface ICommunicationObject
Public Interface IChannelFactory(Of TChannel)
Implements IChannelFactory

類型參數

TChannel

通道處理站所建立的通道型別。The type of channel that the channel factory creates.

衍生
實作

備註

實作 IChannelFactory<TChannel> 合約可讓使用者建立特定型別的多個通道,而不需要每次都指定通道型別。Implementing the IChannelFactory<TChannel> contract allows users to create multiple channels of a given type without having to specify the channel type each time. 換句話說,將通道型別定義為實作 IChannelFactory<TChannel> 介面之通道處理站的泛型參數也就表示,不需要將此型別傳遞到 CreateChannel 方法中。In other words, defining the channel type as a generic parameter for the channel factory implementing the IChannelFactory<TChannel> interface means that it is not necessary to pass the type into the CreateChannel methods. 如果使用者想要建立不同的通道型別,他們可以針對所需的每一個通道型別建立其他通道處理站。If users want to create different channel types, they can create additional channel factories for each type of channel required. CreateChannel(EndpointAddress, Uri) 多載可讓您區分最初傳送訊息的目標位址以及最終目的地。The CreateChannel(EndpointAddress, Uri) overload allows you to distinguish the address to which the message is initially sent from the ultimate destination. 如需定址的討論,請參閱位址主題。For a discussion of addressing, see the Addresses topic.

屬性

State

取得通訊導向物件的目前狀態。Gets the current state of the communication-oriented object.

(繼承來源 ICommunicationObject)

方法

Abort()

導致通訊物件立即從目前的狀態轉換為已關閉狀態。Causes a communication object to transition immediately from its current state into the closed state.

(繼承來源 ICommunicationObject)
BeginClose(AsyncCallback, Object)

開始非同步作業以關閉通訊物件。Begins an asynchronous operation to close a communication object.

(繼承來源 ICommunicationObject)
BeginClose(TimeSpan, AsyncCallback, Object)

開始非同步作業,關閉有已指定逾時的通訊物件。Begins an asynchronous operation to close a communication object with a specified timeout.

(繼承來源 ICommunicationObject)
BeginOpen(AsyncCallback, Object)

開始非同步作業以開啟通訊物件。Begins an asynchronous operation to open a communication object.

(繼承來源 ICommunicationObject)
BeginOpen(TimeSpan, AsyncCallback, Object)

開始非同步作業,開啟有已指定時間間隔的通訊物件。Begins an asynchronous operation to open a communication object within a specified interval of time.

(繼承來源 ICommunicationObject)
Close()

導致通訊物件從目前的狀態轉換為已關閉狀態。Causes a communication object to transition from its current state into the closed state.

(繼承來源 ICommunicationObject)
Close(TimeSpan)

導致通訊物件從目前的狀態轉換為已關閉狀態。Causes a communication object to transition from its current state into the closed state.

(繼承來源 ICommunicationObject)
CreateChannel(EndpointAddress)

建立指向指定之端點位址的指定型別通道。Creates a channel of a specified type to a specified endpoint address.

CreateChannel(EndpointAddress, Uri)

建立指定之端點位址的特定型別通道以及訊息傳送的目標傳輸位址。Creates a channel of a specified type to a specified endpoint address and transport address to which messages are sent.

EndClose(IAsyncResult)

完成非同步作業以關閉通訊物件。Completes an asynchronous operation to close a communication object.

(繼承來源 ICommunicationObject)
EndOpen(IAsyncResult)

完成非同步作業以開啟通訊物件。Completes an asynchronous operation to open a communication object.

(繼承來源 ICommunicationObject)
GetProperty<T>()

從通道堆疊的適當層次中,傳回要求的型別物件 (如果有)。Returns a typed object requested, if present, from the appropriate layer in the channel stack.

(繼承來源 IChannelFactory)
Open()

導致通訊物件從已建立狀態轉換為已開啟狀態。Causes a communication object to transition from the created state into the opened state.

(繼承來源 ICommunicationObject)
Open(TimeSpan)

在指定時間間隔內,讓通訊物件從已建立狀態轉換為已開啟狀態。Causes a communication object to transition from the created state into the opened state within a specified interval of time.

(繼承來源 ICommunicationObject)

事件

Closed

當通訊物件從關閉中狀態轉換為已關閉狀態完成時發生。Occurs when the communication object completes its transition from the closing state into the closed state.

(繼承來源 ICommunicationObject)
Closing

當通訊物件第一次進入關閉中狀態時發生。Occurs when the communication object first enters the closing state.

(繼承來源 ICommunicationObject)
Faulted

當通訊物件第一次進入錯誤狀態時發生。Occurs when the communication object first enters the faulted state.

(繼承來源 ICommunicationObject)
Opened

當通訊物件從開啟中狀態轉換為已開啟狀態結束時發生。Occurs when the communication object completes its transition from the opening state into the opened state.

(繼承來源 ICommunicationObject)
Opening

當通訊物件第一次進入開啟中狀態時發生。Occurs when the communication object first enters the opening state.

(繼承來源 ICommunicationObject)

適用於