Before you start firing at me, I\'m NOT looking to do this, but someone in another post said it was possible. How is it possible? I\'ve never heard of inheriting from anythi
Create a new class called GenericKeyValueBase
put this in it
public class GenericKeyValueBase
{
public TKey Key;
public TValue Value;
public GenericKeyValueBase(TKey ItemKey, TValue ItemValue)
{
Key = ItemKey;
Value = ItemValue;
}
}
And inherit from that plus you can add additional extension methods for Add/Remove (AddAt and RemoveAt) to your new derived class (and make it a collection/dictionary) if you are feeling really cool.
A simple implentation example where you would use a normal System.Collections.Generic.KeyValuePair for a base, but instead can use the above code
class GenericCookieItem : GenericKeyValueBase
{
public GenericCookieItem(TCookieKey KeyValue, TCookieValue ItemValue) : base(KeyValue, ItemValue)
{
}
}