Hi,

On Tue, Nov 30, 2010 at 6:00 PM, Greg Young <[email protected]> wrote:
> everything makes sense so far. however when I look at the third.
> System.Void TestProject.Whatever`1<TSomething>::Handle(T)

There's no Handle method in the type Whatever`1 of your sample. Where
is this coming from?

> but here T is going to be TSomething. Is there any easy way of figuring out
> this? In other words I want to tie together in this case that T is
> TSomething does this make sense?

Cecil, unlike say, System.Reflection, won't replace the
GenericParameters in method signatures by their actual arguments. If
you want to do so, you just have to visit the different parameter
types or return type of the method, and if it's a GenericParameter,
you can try to get its value (the argument) in the generic instance on
which the method is declared.

For instance, if you have something like:

System.Void TestProject.Whatever`1<TSomething>::Handle(T)

The declaring type, Whatever`1<TSomething> is a GenericInstanceType,
with TSomething as a GenericArguments [0]. The type of the parameter
is T, and its position is zero. You can now map T to its argument
TSomething.

Jb

-- 
--
mono-cecil

Reply via email to