J
Jon Shemitz
Suppose you have a dynamically loaded assembly, Assembly. Suppose you
enumerate all the types in Assembly with Assembly.GetExportedTypes().
Suppose you are working with
Type ExportedType;
which you got from Assembly.GetExportedTypes(). What is the type of an
array of elements of the type ExportedType?
(That is, imagine that within the dynamically loaded assembly, there
is a type BaseType, and ExportedType == typeof(BaseType). How do you
get typeof(BaseType[]) if you only have the ExportedType value?)
I have
internal static Type TypeOfArrayOf(Type AnyType)
{
Array A = Array.CreateInstance(AnyType, 0);
return A.GetType();
}
- is there anything better?
enumerate all the types in Assembly with Assembly.GetExportedTypes().
Suppose you are working with
Type ExportedType;
which you got from Assembly.GetExportedTypes(). What is the type of an
array of elements of the type ExportedType?
(That is, imagine that within the dynamically loaded assembly, there
is a type BaseType, and ExportedType == typeof(BaseType). How do you
get typeof(BaseType[]) if you only have the ExportedType value?)
I have
internal static Type TypeOfArrayOf(Type AnyType)
{
Array A = Array.CreateInstance(AnyType, 0);
return A.GetType();
}
- is there anything better?