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

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -