DesignerRegionCollection.IsSynchronized 属性
定义
获取一个值,该值指示对 DesignerRegionCollection 对象的访问是否同步(线程安全)。Gets a value indicating whether access to the DesignerRegionCollection object is synchronized (thread safe).
public:
property bool IsSynchronized { bool get(); };
public bool IsSynchronized { get; }
member this.IsSynchronized : bool
Public ReadOnly Property IsSynchronized As Boolean
属性值
如果对 DesignerRegionCollection 的访问是同步的,则为 true;否则为 false。true, if access to the DesignerRegionCollection is synchronized; otherwise, false.
注解
枚举集合不是一个线程安全的过程。Enumerating through a collection is not a thread-safe procedure intrinsically. 即使集合是同步的,其他线程仍可以修改该集合。Even when a collection is synchronized, other threads can still modify the collection. 这会导致枚举过程中出现异常。This causes exceptions during enumeration.
在 SyncRoot 整个枚举过程中,通过使用方法锁定集合以保证线程安全。Lock the collection by using the SyncRoot method during the whole enumeration to guarantee thread safety.