ActivityTagsCollection.Item[String] 屬性

定義

取得或設定指定的集合項目。Gets or sets a specified collection item.

將某個值設定為此索引子屬性時,將會觀察到下列行為:- 如果索引鍵先前存在於集合中,且值為 null,則會從集合移除符合索引鍵的集合項目。When setting a value to this indexer property, the following behavior is observed: - If the key previously existed in the collection and the value is null, the collection item matching the key will get removed from the collection. - 如果機碼先前存在於集合中,且值不是 null,則此值將會取代儲存在集合中的舊值。- If the key previously existed in the collection and the value is not null, the value will replace the old value stored in the collection. - 否則,新的項目將會加入集合。- Otherwise, a new item will get added to the collection.

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

參數

key
String

要取得或設定之值的索引鍵。The key of the value to get or set.

屬性值

Object

對應至索引鍵的物件。The object mapped to the key.

實作

適用於