Hi All, I need to declare a generic list of a type which is decided at runtime, the type is one of several classes that all implement a common interface , I'm unsure how to do this, at first I thought I could use the Type of the class to create a list but this is not so - a small example of what I mean is shown below
IMyInterFace i = GetClassType();
List<i> mylist = new List<i>();
IMyInterFace GetClassType()
{
if(SomeCondition)
return ClassA;
else
return classB;
}
Regards,
Peter J. Kane
Pete