Ah the call is going out ... sorry its toCall.Handle() I left that out.


On Tue, Nov 30, 2010 at 1:14 PM, Jb Evain <[email protected]> wrote:

> 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




-- 
Les erreurs de grammaire et de syntaxe ont été incluses pour m'assurer de
votre attention

-- 
--
mono-cecil

Reply via email to