N
Néstor Sánchez A.
Hi,
is there a way, maybe using reflection, to use a generic class passing the
type parameter dynamicly (not kwnowing the exact type at compile time)?
I tried the next example, but doesn't work:
public abstract class Vehicle
{ ... }
public class Aircraft : Vehicle
{ ... }
public class SimpleList<AType> where AType:Vehicle
{
....
}
call:
Aircraft Boeing747 = new Aircraft();
SimpleList<typeof(Aircraft)> TheList = new
SimpleList<Boeing747.GetType()>();
....
Thanks,
Néstor.
is there a way, maybe using reflection, to use a generic class passing the
type parameter dynamicly (not kwnowing the exact type at compile time)?
I tried the next example, but doesn't work:
public abstract class Vehicle
{ ... }
public class Aircraft : Vehicle
{ ... }
public class SimpleList<AType> where AType:Vehicle
{
....
}
call:
Aircraft Boeing747 = new Aircraft();
SimpleList<typeof(Aircraft)> TheList = new
SimpleList<Boeing747.GetType()>();
....
Thanks,
Néstor.