I need to know how to override the Add-method of a certain Dictionary in a certain static class. Any suggestions?
If it matters, the dictionary looks like this:
It's actually simpler to use the "new" keyword. I do this often when my objects contain thier own unique ID value.
// Warning Air Code - Subject to bonehead mistakes
internal sealed class SomeDict : Dictionary
{
public new void Add(myKeyType key, myObjectType value)
{
this.Add(value);
}
internal void Add(myObjectType value)
{
base.Add(value.Id, value);
}
}