語言

NameObjectCollectionBase.KeysCollection 類別

定義

代表集合中的密鑰集合 String 。

public: ref class NameObjectCollectionBase::KeysCollection : System::Collections::ICollection
public class NameObjectCollectionBase.KeysCollection : System.Collections.ICollection
[System.Serializable]
public class NameObjectCollectionBase.KeysCollection : System.Collections.ICollection
type NameObjectCollectionBase.KeysCollection = class
    interface ICollection
    interface IEnumerable
[<System.Serializable>]
type NameObjectCollectionBase.KeysCollection = class
    interface ICollection
    interface IEnumerable
Public Class NameObjectCollectionBase.KeysCollection
Implements ICollection
繼承
NameObjectCollectionBase.KeysCollection
屬性
實作

屬性

名稱 Description
Count

取得 .NameObjectCollectionBase.KeysCollection

Item[Int32]

取得集合指定索引的條目。

方法

名稱 Description
Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
Get(Int32)

在集合指定的索引處取得金鑰。

GetEnumerator()

回傳一個遍歷 的 NameObjectCollectionBase.KeysCollection枚舉子。

GetHashCode()

做為預設哈希函式。

(繼承來源 Object)
GetType()

取得目前實例的 Type。

(繼承來源 Object)
MemberwiseClone()

建立目前 Object的淺層複本。

(繼承來源 Object)
ToString()

傳回表示目前 物件的字串。

(繼承來源 Object)

明確介面實作

名稱 Description
ICollection.CopyTo(Array, Int32)

從目標陣列的指定索引開始,將整個 NameObjectCollectionBase.KeysCollection 複製到相容的一維 Array。

ICollection.IsSynchronized

取得值,指出是否同步存取 NameObjectCollectionBase.KeysCollection (線程安全)。

ICollection.SyncRoot

取得一個物件,可用來同步存取 NameObjectCollectionBase.KeysCollection。

擴充方法

名稱 Description
AsParallel(IEnumerable)

啟用查詢的平行處理。

AsQueryable(IEnumerable)

將 IEnumerable 轉換成 IQueryable。

Cast<TResult>(IEnumerable)

將 IEnumerable 的項目轉換成指定的型別。

OfType<TResult>(IEnumerable)

根據指定的型別篩選 IEnumerable 的專案。

適用於

執行緒安全性

此類型的公用靜態 (Shared) 成員是安全線程。 任何實例成員都不保證具有執行緒安全性。

此實作未提供同步(執行緒安全)包裝器,NameObjectCollectionBase.KeysCollection但衍生類別可利用該NameObjectCollectionBase.KeysCollection屬性建立自己的同步版本SyncRoot。

透過集合列舉本質上不是安全線程的程式。 即使集合同步處理,其他線程仍然可以修改集合,這會導致列舉值擲回例外狀況。 若要保證列舉期間的線程安全性,您可以在整個列舉期間鎖定集合,或攔截其他線程所做的變更所產生的例外狀況。