On Tue, Jul 12, 2011 at 8:49 AM, torman <[email protected]> wrote:
> The strange thing is: I can get the anonymous method and the body of
> this method
> via Mono.Cecil.

What is strange about that?

> Because when I check the TypeDefinition of my class (in which the
> delegate is located) I
> can find the MethodDefinition with name "<ContainingMethodName>b__0".
> If I have multiple
> delegates the names are "<ContainingMethodName>b__1",
> "<ContainingMethodName>b__2" and
> so on.

Yes, that's pretty much expected :)

> But I can't get the connection between the MethodReference to
> "SPSecurity.RunWithElevatedPrivileges" and the anonymous method
> "<ContainingMethodName>b__0".

Because there's no connection, besides the fact that the method
RunWithElevatedPrivileges will be invoked with an instance of a
delegate pointing to your b__0 generated method?

Jb

-- 
--
mono-cecil

Reply via email to