Would that actually be a good method to retrieve a MethodDefinition?

var profilingManagerUpdateMethod =
typeDefinition.Module.AssemblyResolver.Resolve("Indiefreaks.AOP.Profiler").MainModule.Types.First(match
=> match.Name.Equals("ProfilerAttribute")).Methods.First(match =>
match.Name.Equals("Update"));
var il = drawMethod.Body.GetILProcessor();
il.InsertBefore(il.Body.Instructions.Last(), il.Create(OpCodes.Call,
typeDefinition.Module.Import(profilingManagerUpdateMethod)));

Thanks

On Jun 24, 1:58 pm, "Indiefreaks.com" <[email protected]>
wrote:
> Actually, it isn't a viable solution since it is very limited to
> which .net framework class members are supported. For instance, it
> won't support System.GC.GetTotalMemory() which I use to measure
> allocated bytes :^p
>
> Thanks anyway.
>
> On Jun 24, 3:31 am, Simon <[email protected]> wrote:
>
>
>
> > would the portable library tools help 
> > you??http://visualstudiogallery.msdn.microsoft.com/b0e0b5e9-e138-410b-ad10...-
> >  Hide quoted text -
>
> - Show quoted text -

-- 
--
mono-cecil

Reply via email to