IExtensibleObject<T> 介面

定義

讓物件參與自訂行為 (如註冊事件),或監控狀態轉換。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)

類型參數

T

擴充功能類別的型別。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.

屬性

Extensions

取得這個可擴充物件的擴充功能物件集合。Gets a collection of extension objects for this extensible object.

適用於