IExtension<T> 介面

定義

讓物件可以透過彙總 (Aggregation) 擴充另一個物件。Enables an object to extend another object through aggregation.

generic <typename T>
 where T : IExtensibleObject<T>public interface class IExtension
public interface IExtension<T> where T : IExtensibleObject<T>
type IExtension<'T (requires 'T :> IExtensibleObject<'T>)> = interface
Public Interface IExtension(Of T)

類型參數

T

參與自訂行為的物件。The object that participates in the custom behavior.

衍生

備註

WCF 可讓您使用其可延伸物件模式加入新狀態或行為,以擴充 System.ServiceModel.IExtensibleObject<T> 物件(System.ServiceModel.IContextChannelSystem.ServiceModel.ServiceHostSystem.ServiceModel.InstanceContextSystem.ServiceModel.OperationContext 類別)。WCF allows you to extend System.ServiceModel.IExtensibleObject<T> objects (the System.ServiceModel.IContextChannel, System.ServiceModel.ServiceHost, System.ServiceModel.InstanceContext, and System.ServiceModel.OperationContext classes) by adding a new state or behavior by using its extensible object pattern. 可延伸物件模式在 WCF 中用來以新功能來擴充現有的執行時間類別,或將新的狀態功能加入至物件。The extensible object pattern is used in WCF to either extend existing run-time classes with new functionality or to add new state features to an object.

方法

Attach(T)

讓擴充物件可以找出它被彚總的時間。Enables an extension object to find out when it has been aggregated. 當擴充加入至 Extensions 屬性時呼叫。Called when the extension is added to the Extensions property.

Detach(T)

讓擴充物件可以找出它不再被彚總的時間。Enables an object to find out when it is no longer aggregated. 當擴充從 Extensions 屬性中移除時呼叫。Called when an extension is removed from the Extensions property.

適用於