Discussion:
[Ikvm-developers] How to create instances at runtime (IKVM.Reflection)
Jörg Taubert
2017-01-23 11:24:47 UTC
Permalink
Hello,



is there a way to create instances at runtime using IKVM.Reflection?

I would like to replace the following code with the parameter „type“ of type
IKVM.Reflection.Type instead of System.Type.



Parameters:

IKVM.Reflection.Type type

int[] arrayDimensions



var instance = arrayDimensions != null

? Array.CreateInstance(type, arrayDimensions)

: Activator.CreateInstance(type);



Friendly regards

Joerg
Jeroen Frijters
2017-01-23 17:24:30 UTC
Permalink
No, the whole point of IKVM.Reflection is to be completely decoupled from the runtime.

From: Jörg Taubert [mailto:***@mastersoft-gmbh.de]
Sent: Monday, January 23, 2017 12:25
To: ikvm-***@lists.sourceforge.net
Subject: [Ikvm-developers] How to create instances at runtime (IKVM.Reflection)

Hello,

is there a way to create instances at runtime using IKVM.Reflection?
I would like to replace the following code with the parameter "type" of type IKVM.Reflection.Type instead of System.Type.

Parameters:
IKVM.Reflection.Type type
int[] arrayDimensions

var instance = arrayDimensions != null
? Array.CreateInstance(type, arrayDimensions)
: Activator.CreateInstance(type);

Friendly regards
Joerg

Loading...