Getting Array Type From Type

  • Thread starter Thread starter gary
  • Start date Start date
G

gary

Currently I am doing the following to find an one dimensional array
type of a type -

Type asSingle;

Type asArray = Array.CreateInstance ( asSingle , 0 ).GetType ( );


Is there a way to do this without creating an instance?

I do not know the array type at design time.


Thanks in advance,

Gary
 
Currently I am doing the following to find an one dimensional array
type of a type -

Type asSingle;

Type asArray = Array.CreateInstance ( asSingle , 0 ).GetType ( );


Is there a way to do this without creating an instance?

I do not know the array type at design time.


Thanks in advance,

Gary

What about (assuming .net 2):

asSingle.GetType().MakeArrayType();
 
Back
Top