BaseCollection.SyncRoot 属性

定义

获取可用于同步对 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; }
[<System.ComponentModel.Browsable(false)>]
member this.SyncRoot : obj
Public ReadOnly Property SyncRoot As Object

属性值

Object

可用于同步 BaseCollection 的对象。An object that can be used to synchronize the BaseCollection.

实现

属性

注解

如果与相同,则 BaseCollection IsSynchronized 属性返回 false ,然后 SyncRoot 属性返回可与 c # 关键字一起使用的对象 lockIf, 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.

适用于