IInheritanceService 介面

定義

提供識別某個元件的元件之方法。Provides methods for identifying the components of a component.

public interface class IInheritanceService
public interface IInheritanceService
type IInheritanceService = interface
Public Interface IInheritanceService
衍生

備註

這個介面提供的方法可用於識別繼承自基類之元件的元件。This interface provides methods that can be used to identify components of a component that are inherited from a base class.

若要判斷繼承哪些元件,請呼叫 AddInheritedComponents 方法,並將該元件傳遞至搜尋,並將 IContainer 儲存至已識別之元件的參考。To determine what components are inherited, call the AddInheritedComponents method and pass the component to search and an IContainer to store references to the identified components. 呼叫 GetInheritanceAttribute 方法,以取得 AddInheritedComponents 方法已識別之元件的 InheritanceAttributeCall the GetInheritanceAttribute method to retrieve an InheritanceAttribute for a component that has been identified by the AddInheritedComponents method.

方法

AddInheritedComponents(IComponent, IContainer)

搜尋指定的元件,以找出實作 IComponent 介面的欄位,並將每一個欄位加入指定的容器,以儲存每一個欄位的繼承層級 (可利用 GetInheritanceAttribute(IComponent) 方法來擷取繼承層級)。Searches the specified component for fields that implement the IComponent interface and adds each to the specified container, storing the inheritance level of each which can be retrieved using the GetInheritanceAttribute(IComponent) method.

GetInheritanceAttribute(IComponent)

取得指定元件的繼承屬性。Gets the inheritance attribute for the specified component.

適用於

另請參閱