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:
Another "quick and dirty" fix
If you need to add some extra logic to the Add method, you can create your own method, with a slightly different signature, and use THAT in your code.
public class MyOwnDictionary: Dictionary
{
public void AddPlus(TKey key, TValue value)
{
//some custom logic here
base.Add(key,value);
}
}
(but this can lead to maintenance difficulties)