Share via


PropertyValueCollection.Item[Int32] 屬性

定義

取得或設定在這個集合中指定索引處的屬性值。

public:
 property System::Object ^ default[int] { System::Object ^ get(int index); void set(int index, System::Object ^ value); };
public object this[int index] { get; set; }
public object? this[int index] { get; set; }
member this.Item(int) : obj with get, set
Default Public Property Item(index As Integer) As Object

參數

index
Int32

屬性值之以零起始的索引。

屬性值

在指定索引處的屬性值。

例外狀況

屬性值為 null 參考 (在 Visual Basic 中為 Nothing)。

索引小於零 (0) 或大於集合的大小。

備註

在 C# 中,這個屬性是 PropertyValueCollection 類別的索引子。

在 JScript 中,您可以使用類型所定義的預設索引屬性,但是不能明確定義自己的屬性。 不過,在類別上指定 expando 屬性會自動提供類型為 Object 且索引類型為 String的預設索引屬性。

適用於