I have a generic class definition similar to this:
public sealed class MyClass<TProperty,TOwner>
{
...
}
Now I'd like any instances of MyClass<TProperty,TOwner>
regardless of the types of TProperty or TOwner to share a Hashtable. I thought of creating an internal MyClassBase with a protected internal static field of type Hashtable and inherit from that. I really only want the definition of MyClass to have access to this hashtable.
Is this a sound approach? I can't seal MyClassBase, so this probably could lead to opening a can of worms later on...
Are there other approaches for this?