Exemplo n.º 1
0
        public static CallInfo[] For(System.Reflection.MethodInfo method, Func <string, bool> filter = null)
        {
            var module = Mono.Cecil.ModuleDefinition.ReadModule(method.DeclaringType.Assembly.Location, new Mono.Cecil.ReaderParameters {
                InMemory = true
            });
            var retval = new CallCollector(module);
            var md     = module.FindType(method.DeclaringType.FullName).Resolve().FindMethod(method.Name, method.GetParameters().Select(p => module.ImportReference(p.ParameterType)).ToArray());

            return(retval.Collect(md.Resolve(), i => filter(i.TargetMethod().FullName)));
        }
Exemplo n.º 2
0
 public override void BeforeModule(ModuleDefinition module)
 {
     callCollector        = new CallCollector(module);
     logDefinitionFactory = new LoggerDefinitionFactory(module);
 }