BaseCollection.SyncRoot BaseCollection.SyncRoot BaseCollection.SyncRoot BaseCollection.SyncRoot Property

定義

取得可用以同步存取 BaseCollection 的物件。Gets an object that can be used to synchronize access to the BaseCollection.

public:
 property System::Object ^ SyncRoot { System::Object ^ get(); };
[System.ComponentModel.Browsable(false)]
public object SyncRoot { get; }
member this.SyncRoot : obj
Public ReadOnly Property SyncRoot As Object

屬性值

可用來將 BaseCollection 同步化的物件。An object that can be used to synchronize the BaseCollection.

實作

備註

如果,正如同使用BaseCollection,則IsSynchronized屬性會傳回false,則SyncRoot屬性會傳回物件,可搭配 C#lock關鍵字。If, as is the case with the BaseCollection, the IsSynchronized property returns false, then the SyncRoot property returns an object that can be used with the C# lock keyword.

適用於