IExtension<T> IExtension<T> IExtension<T> IExtension<T> Interface


使对象可以通过聚合扩展另一个对象。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)



参与自定义行为的对象。The object that participates in the custom behavior.



WCF 可以进行扩展System.ServiceModel.IExtensibleObject<T>对象 ( System.ServiceModel.IContextChannelSystem.ServiceModel.ServiceHostSystem.ServiceModel.InstanceContext,和System.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) Attach(T) Attach(T) 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) Detach(T) Detach(T) 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.