Type genericListType = typeof(List<>);
Type[] typeArgs = new[] { instance.GetType() };
var generic = genericListType.MakeGenericType(typeArgs);
System.Collections.IList list = (System.Collections.IList)Activator.CreateInstance(generic);
foreach (dynamic item in list)
{
//whatever
}
Hope i got you right..
EDIT something more usable,
This approach has not much advantages to a ArrayList just there are Exceptions at runtime if you try to add something different then the specific runtime type. While ArrayList will not throw an exception in the case the "wrong" item is added instead there will or will not be an exception if you use the items. I do (even if i don't know the Type at compile time) try to use the concrete generic instead of an open ArrayList, because the exception is raised at the right codeline (IMHO).