ComponentCollection.Item[] 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取集合中与指定名称匹配的任何组件。
重载
| 名称 | 说明 |
|---|---|
| Item[Int32] |
获取 Component 指定集合索引处的集合中的值。 |
| Item[String] |
获取集合中与指定名称匹配的任何组件。 |
Item[Int32]
- Source:
- ComponentCollection.cs
- Source:
- ComponentCollection.cs
- Source:
- ComponentCollection.cs
- Source:
- ComponentCollection.cs
- Source:
- ComponentCollection.cs
获取 Component 指定集合索引处的集合中的值。
public:
virtual property System::ComponentModel::IComponent ^ default[int] { System::ComponentModel::IComponent ^ get(int index); };
public virtual System.ComponentModel.IComponent? this[int index] { get; }
public virtual System.ComponentModel.IComponent this[int index] { get; }
member this.Item(int) : System.ComponentModel.IComponent
Default Public Overridable ReadOnly Property Item(index As Integer) As IComponent
参数
属性值
位于 IComponent 指定索引处。
例外
如果指定的索引不在集合的索引范围内。
注解
此方法可由派生类重写。
适用于
Item[String]
- Source:
- ComponentCollection.cs
- Source:
- ComponentCollection.cs
- Source:
- ComponentCollection.cs
- Source:
- ComponentCollection.cs
- Source:
- ComponentCollection.cs
获取集合中与指定名称匹配的任何组件。
public:
virtual property System::ComponentModel::IComponent ^ default[System::String ^] { System::ComponentModel::IComponent ^ get(System::String ^ name); };
public virtual System.ComponentModel.IComponent? this[string? name] { get; }
public virtual System.ComponentModel.IComponent this[string name] { get; }
member this.Item(string) : System.ComponentModel.IComponent
Default Public Overridable ReadOnly Property Item(name As String) As IComponent
参数
- name
- String
要获取的名称 IComponent 。
属性值
名称与参数指定 name 的名称匹配的组件,或者 null 无法在集合中找到命名组件。
注解
此方法可由派生类重写。
如果集合Site中的属性不是null,并且其Site属性的属性与指定的字符串匹配,Name则此属性将返回IComponent集合中。
注释
此字符串索引器仅在组件被站点化时才有效,该组件通常在设计时发生。 若要在运行时对站点进行 Component 站点,请设置 Site . Component的属性。 Name还必须设置设置为该属性的属性ISiteSite,以便此属性返回组件。