StringDictionary.IsSynchronized property is used to get a value indicating whether access to the StringDictionary is synchronized (thread-safe).
Syntax:
public virtual bool IsSynchronized { get; }
Return Value: This method returns True if access to the StringDictionary is synchronized (thread safe), otherwise it returns False.
Example:
// C# code to check if StringDictionary // is synchronized (thread safe) using System; using System.Collections; using System.Collections.Specialized; class GFG { // Driver code public static void Main() { // Creating a StringDictionary named myDict StringDictionary myDict = new StringDictionary(); // Adding key and value into the StringDictionary myDict.Add("A", "Apple"); myDict.Add("B", "Banana"); myDict.Add("C", "Cat"); myDict.Add("D", "Dog"); myDict.Add("E", "Elephant"); // Checking if StringDictionary // is synchronized (thread safe) Console.WriteLine(myDict.IsSynchronized); } } |
chevron_right
filter_none
Output:
False
Note:
- Retrieving the value of this property is an O(1) operation.
- A StringDictionary instance is not synchronized. Derived classes can provide a synchronized version of the StringDictionary using the SyncRoot property.
Recommended Posts:
- C# | Check if StringCollection is synchronized (thread safe)
- C# | Check if the BitArray is synchronized (thread safe)
- C# | Check if ListDictionary is synchronized (thread safe)
- C# | Check if HybridDictionary is Synchronized (thread safe)
- C# | Check if Hashtable is synchronized (thread safe)
- C# | Check if ArrayList is Synchronized (thread safe)
- C# | Check if an array is synchronized (thread safe) or not
- C# | Creating a synchronized (thread-safe) wrapper for a SortedList object
- C# | Creating a synchronized (thread-safe) wrapper for the Hashtable
- C# | Creating a synchronized (thread-safe) wrapper for the ArrayList
- How to check whether a thread is a background thread or not in C#
- C# | Check if a thread belongs to managed thread pool or not
- Naming a thread and fetching name of current thread in C#
- C# | Check if a SortedList object is synchronized
- C# | Check if the StringDictionary contains a specific value
- C# | Check if the StringDictionary contains a specific key
- C# | Check if two StringDictionary objects are equal or not
- Queue.Synchronized() Method in C#
- Stack.Synchronized() Method in C#
- C# | Get the number of key/value pairs in the StringDictionary
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

