custom collection using generics

  • Thread starter Thread starter Dan Holmes
  • Start date Start date
D

Dan Holmes

Given the Class named KeyValue is the declaration for the Dictionary
version correct? I can't get the IDE to like it. This is VS2005 beta
2. I think i am doing something wrong but i don't see it.

Public Class KeyValue
Dim _keyID As FieldAttributes
Dim _value As FieldAttributes
'public accessors omitted
End Class
Public Class KeyValueDictionary(Of KeyValue) : Inherits DictionaryBase
Public Sub Add(ByVal value As KeyValue)
Dictionary.Add(value.keyID.value, value) 'ide doesn't like this line.
End Sub 'Add
end Class

dan
 
Hi,

Try this instead

Public Class KeyValueDictionary: Inherits DictionaryBase
Public Sub Add(ByVal value As KeyValue)
Dictionary.Add(value.keyID.value, value) 'ide doesn't like this line.
End Sub 'Add
end Class

Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top