IExtensibleObject<T> Interface


使对象可以参与自定义行为,例如注册事件或监视状态转换等。Enable an object to participate in custom behavior, such as registering for events, or watching state transitions.

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

Type Parameters


扩展类的类型。The type of the extension class.



实现 IExtensibleObject<T> 以启用扩展聚合。Implement IExtensibleObject<T> to enable aggregation of extensions.

例如,如果要实现 TreeNode 类并希望允许外部代码将批注和方法添加到某些 TreeNode 实例中,则可以让 TreeNode 实现 IExtensibleObject<TreeNode>For example, if you are implementing a TreeNode class and want to allow external code to add annotations and methods to some instances of TreeNode, you can have TreeNode implement IExtensibleObject<TreeNode>. 这使得使用 TreeNode 的代码可以将实现 IExtensibleObject<TreeNode> 的对象添加到 Extensions 集合中。This enables code that uses TreeNode to add objects that implement IExtensibleObject<TreeNode> to the Extensions collection.

Windows Communication Foundation (WCF)中有四个可扩展对象:There are four extensible objects in Windows Communication Foundation (WCF):

有关如何创建扩展以使用这些对象的讨论,请参阅可扩展对象For a discussion about how to create extension to work with these objects, see Extensible Objects.



获取此可扩展对象的扩展对象集合。Gets a collection of extension objects for this extensible object.

Applies to