|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Reflection: Creating an array of a type?Hi,
I'd like to create an array of a Type. How can I do that using reflection? Currently I'm using the following code to create single instances: constr=type.GetConstructor(new Type[]{...}); newObj=constr.Invoke(new object[]{...}); Now I need to create a typed array of that type to store a number of these instances. How can I do that? Any help is quite appreciated! TIA, Axel Dahmen Axel,
>Now I need to create a typed array of that type to store a number of these Array.CreateInstance>instances. How can I do that? Mattias -- Mattias Sjögren [C# MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup. Great! Thanks, Matthias!
-------------- Show quote "Mattias Sjögren" <mattias.dont.want.spam@mvps.org> wrote in message news:uiV6YStQGHA.4312@TK2MSFTNGP12.phx.gbl... > Axel, > > >Now I need to create a typed array of that type to store a number of these > >instances. How can I do that? > > Array.CreateInstance > > > Mattias > > -- > Mattias Sjögren [C# MVP] mattias @ mvps.org > http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com > Please reply only to the newsgroup. |
|||||||||||||||||||||||