InheritanceService.AddInheritedComponents 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將指定組件繼承的組件加入 InheritanceService。
多載
| 名稱 | Description |
|---|---|
| AddInheritedComponents(IComponent, IContainer) |
將指定組件繼承的組件加入 InheritanceService。 |
| AddInheritedComponents(Type, IComponent, IContainer) |
將指定類型中由該元件繼承的組件加入 InheritanceService。 |
AddInheritedComponents(IComponent, IContainer)
將指定組件繼承的組件加入 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
用來搜尋繼承元件以加入指定容器的元件。
- container
- IContainer
用來加入繼承元件的容器。
實作
備註
此方法會搜尋指定元件所有基底類別的所有欄位。 每個實 IComponent 作的欄位都會被加入指定的容器中。
另請參閱
適用於
AddInheritedComponents(Type, IComponent, IContainer)
將指定類型中由該元件繼承的組件加入 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);
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
Protected Overridable Sub AddInheritedComponents (type As Type, component As IComponent, container As IContainer)
參數
- type
- Type
要搜尋的基礎類型。
- component
- IComponent
用來搜尋繼承元件以加入指定容器的元件。
- container
- IContainer
用來加入繼承元件的容器。
備註
此方法搜尋所有元件基類的所有欄位。 每個實 IComponent 作的欄位都會被加入一個內部清單,該清單儲存 InheritanceAttribute 一個,該清單能識別該元件的繼承層級。 元件隨後被加入指定的容器中。