' In myModule1 - straight out of the online VB.Net help
Public Class DeviceDictionary
Inherits DictionaryBase
Default Public Property Item(ByVal key As [String]) As [String]
Get
Return CType(Dictionary(key), [String])
End Get
Set(ByVal Value As [String])
Dictionary(key) = Value
End Set
End Property
Public ReadOnly Property Keys() As ICollection
Get
Return Dictionary.Keys
End Get
End Property
Public ReadOnly Property Values() As ICollection
Get
Return Dictionary.Values
End Get
End Property
Public Sub Add(ByVal key As [String], ByVal value As [String])
Dictionary.Add(key, value)
End Sub 'Add
Public Function Contains(ByVal key As [String]) As Boolean
Return Dictionary.Contains(key)
End Function 'Contains
Public Sub Remove(ByVal key As [String])
Dictionary.Remove(key)
End Sub 'Remove
End Class
' My Code ---
Public g_devlist As New DeviceDictionary
Dim myDE as DictionaryEntry
....
' Iterate through the DeviceDictionary
For Each myDE in g_devlist
' Do my thing, but I need it in SORTED order!
Next