Okay, this is the case:
I got a generic base-class which I need to initialize with some static values. These values have nothing to do with the kind of types my generic baseclass is loaded with.
I want to be able to do something like this:
GenericBaseclass.Initialize(AssociatedObject);
while also having a class doing like this:
public class DerivedClass : GenericBaseclass<int>
{
...
}
Is there any way to accomplish this? I could make a non-generic baseclass and put the static method there, but I don’t like that “hack” 🙂
If the values have nothing to do with the type of the generic base class, then they shouldn’t be in the generic base class. They should either be in a completely separate class, or in a non-generic base class of the generic class.
Bear in mind that for static variables, you get a different static variable per type argument combination:
It sounds like you don’t really want a different static variable per
Tof your generic base class – so you can’t have it in your generic base class.