I created my own Dictionary class, based on the .NET Dictionary.
Now I want to overload then Item() Method. This works fine with the following code:
Public Overloads Property Item(ByVal key As TKey) As TValue
Get
Return Nothing
End Get
Set(ByVal value As TValue)
MyBase.Item(key) = value
End Set
End Property
When I now use Dictionary.Item(Key) to access a value I get Nothing. But when I use the Dictionary(Key) syntax I get the value and not Nothing.
How can I correctly overload Dictionary.Item(Key) AND Dictionary(Key)?
Thank you
Torben
The property must be marked
Defaultto enable the indexer syntax.