VB.NET: How to overload Dictionary.Item(TKey) -
i created own dictionary class, based on .net dictionary.
now want overload item() method. works fine following code:
public overloads property item(byval key tkey) tvalue return nothing end set(byval value tvalue) mybase.item(key) = value end set end property
when use dictionary.item(key) access value nothing. when use dictionary(key) syntax value , not nothing.
how can correctly overload dictionary.item(key) , dictionary(key)?
thank torben
the property must marked default
enable indexer syntax.
public overloads default property item(byval key tkey) tvalue return nothing end set(byval value tvalue) mybase.item(key) = value end set end property
Comments
Post a Comment