SortedList.IsSynchronized Property tells whether access to a SortedList object is synchronized (thread safe).
Imports System
Imports System.Collections
Imports Microsoft.VisualBasic
Public Class SamplesSortedList
Public Shared Sub Main()
Dim mySL As New SortedList()
mySL.Add(2, "two")
Dim mySyncdSL As SortedList = SortedList.Synchronized(mySL)
If mySL.IsSynchronized Then
Console.WriteLine("synchronized")
Else
Console.WriteLine("not synchronized")
End If
If mySyncdSL.IsSynchronized Then
Console.WriteLine("synchronized")
Else
Console.WriteLine("not synchronized")
End If
End Sub
End Class