C# ListDictionary SyncRoot
Description
ListDictionary SyncRoot
gets an object that can be used
to synchronize access to the ListDictionary.
Syntax
ListDictionary.SyncRoot
has the following syntax.
public Object SyncRoot { get; }
Example
using System;//w ww . j a v a 2 s . c o m
using System.Collections;
using System.Collections.Specialized;
public class SamplesListDictionary {
public static void Main() {
ListDictionary myCollection = new ListDictionary();
lock(myCollection.SyncRoot)
{
foreach (object item in myCollection)
{
// Insert your code here.
}
}
}
}