私の基本クラスは、派生クラスのリフレクションを使用して、それらにいくつかの機能を提供します。現在、私はこのようにしています:
abstract class BaseClass<T>
{
string GetClassString()
{
// Iterate through derived class, and play with it's properties
// So I need to know the type of derived class (here T).
return result;
}
static bool TryParse(string classString, out T result)
{
// I should declare a variable as T and return it
}
}
ジェネリックなしでこれを行うことはできますか?