I have a generic class and I will derive about 20 different classes from it, each with a different datatype for the generic part. The Generic class will have a static field called ConfigField which identifies a field in a configuration file. I want to calculate this field by using a combination of the name of the derived class plus the name of the generic datatype that it wraps. So, example:
class BaseClass<T>
{
static string ConfigField = string.format("{0}.{1}", ???, ???);
}
class DerivedInt: BaseClass<int>{}
class DerivedLong: BaseClass<long>{}
class DerivedString: BaseClass<string>{}
...
Console.WriteLn(DerivedString.ConfigField);
Which should result in "DerivedString.string" as result. Or is this not possible, since it's a static field, thus it exists only in the Generic base class? If so, any other solutions?
static?