Check if a SortedList is read-only in CSharp
Description
The following code shows how to check if a SortedList is read-only.
Example
using System; /*from www.jav a 2 s . co m*/
using System.Collections;
class MainClass {
public static void Main() {
SortedList sl = new SortedList();
sl.Add("a", "A");
sl.Add("b", "B");
sl.Add("c", "C");
sl.Add("d", "D");
Console.WriteLine(sl.IsReadOnly);
}
}
The code above generates the following result.