InheritanceService.AddInheritedComponents 方法

定義

會將指定元件所繼承的元件加入 InheritanceServiceAdds the components inherited by the specified component to the InheritanceService.

多載

AddInheritedComponents(IComponent, IContainer)

會將指定元件所繼承的元件加入 InheritanceServiceAdds the components inherited by the specified component to the InheritanceService.

AddInheritedComponents(Type, IComponent, IContainer)

將由指定元件繼承的指定型別之元件加入 InheritanceServiceAdds the components of the specified type that are inherited by the specified component to the InheritanceService.

AddInheritedComponents(IComponent, IContainer)

會將指定元件所繼承的元件加入 InheritanceServiceAdds the components inherited by the specified component to the InheritanceService.

public:
 virtual void AddInheritedComponents(System::ComponentModel::IComponent ^ component, System::ComponentModel::IContainer ^ container);
public void AddInheritedComponents (System.ComponentModel.IComponent component, System.ComponentModel.IContainer container);
abstract member AddInheritedComponents : System.ComponentModel.IComponent * System.ComponentModel.IContainer -> unit
override this.AddInheritedComponents : System.ComponentModel.IComponent * System.ComponentModel.IContainer -> unit
Public Sub AddInheritedComponents (component As IComponent, container As IContainer)

參數

component
IComponent

元件,用來搜尋要加入至指定容器的繼承元件。The component to search for inherited components to add to the specified container.

container
IContainer

要加入繼承元件的容器。The container to add the inherited components to.

實作

備註

這個方法會搜尋指定元件之所有基類的所有欄位。This method searches all the fields of all base classes of the specified component. 每個執行 IComponent 的欄位都會加入至指定的容器。Each field that implements IComponent is added to the specified container.

另請參閱

AddInheritedComponents(Type, IComponent, IContainer)

將由指定元件繼承的指定型別之元件加入 InheritanceServiceAdds the components of the specified type that are inherited by the specified component to the InheritanceService.

protected:
 virtual void AddInheritedComponents(Type ^ type, System::ComponentModel::IComponent ^ component, System::ComponentModel::IContainer ^ container);
protected virtual void AddInheritedComponents (Type type, System.ComponentModel.IComponent component, System.ComponentModel.IContainer container);
abstract member AddInheritedComponents : Type * System.ComponentModel.IComponent * System.ComponentModel.IContainer -> unit
override this.AddInheritedComponents : Type * System.ComponentModel.IComponent * System.ComponentModel.IContainer -> unit

參數

type
Type

要搜尋的基底型別。The base type to search for.

component
IComponent

元件,用來搜尋要加入至指定容器的繼承元件。The component to search for inherited components to add to the specified container.

container
IContainer

要加入繼承元件的容器。The container to add the inherited components to.

備註

這個方法會搜尋元件之所有基類的所有欄位。This method searches all the fields of all base classes of component. 每個執行 IComponent 的欄位都會加入至內部清單,其中儲存識別元件繼承層級的 InheritanceAttributeEach field that implements IComponent is added to an internal list that stores an InheritanceAttribute that identifies the inheritance level of the component. 然後,元件會新增至指定的容器。The component is then added to the specified container.

適用於