On Sat, Apr 30, 2011 at 11:46 AM, Steves <[email protected]> wrote:
> I am missing one thing to implement this: when I have a reference to
> say List<int>, I can get System.Int32 through
> ((GenericInstanceType)myReference).GenericArguments. How can I get the
> information that System.Int32 is actually generic parameter "T"? In
> debugger I can see that myReference has property
> Mono.Cecil.IGenericContext.Type, which contains the GenericParameter
> "T", but the Mono.Cecil.IGenericContext interface is internal.

You can write:

var list_int32_ref = (GenericInstanceType) myReference;
var int32_ref = genericInstance.GenericArguments [0];
var list_ref = genericInstance.ElementType;
var t = list_ref.GenericParameters [0];

Jb

-- 
--
mono-cecil

Reply via email to