ColumnDefinitionCollection.SyncRoot ColumnDefinitionCollection.SyncRoot ColumnDefinitionCollection.SyncRoot ColumnDefinitionCollection.SyncRoot Property

定義

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

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

屬性值

可用以同步存取 ColumnDefinitionCollection 的物件。An object that can be used to synchronize access to the ColumnDefinitionCollection.

實作

備註

透過集合進行列舉在本質上並非安全執行緒程序。Enumerating through a collection is intrinsically not a thread-safe procedure. 即使集合經過同步化,其他的執行緒仍可修改該集合,使列舉值擲回例外狀況。Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. 若要保證列舉期間的執行緒安全,您可以在整個列舉過程中鎖定集合,或攔截的例外狀況所導致的其他執行緒所做的變更。To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions that result from changes made by other threads.

適用於