public MethodInjector(InterceptorFinder interceptorFinder, DelegateHolderInjector delegateHolderInjector, MsCoreReferenceFinder msCoreReferenceFinder, EventInvokerNameResolver eventInvokerNameResolver) { this.interceptorFinder = interceptorFinder; this.delegateHolderInjector = delegateHolderInjector; this.msCoreReferenceFinder = msCoreReferenceFinder; this.eventInvokerNameResolver = eventInvokerNameResolver; }
public MethodInjector(InterceptorFinder interceptorFinder, DelegateHolderInjector delegateHolderInjector, MsCoreReferenceFinder msCoreReferenceFinder, EventInvokerNameResolver eventInvokerNameResolver) { this.interceptorFinder = interceptorFinder; this.delegateHolderInjector = delegateHolderInjector; this.msCoreReferenceFinder = msCoreReferenceFinder; this.eventInvokerNameResolver = eventInvokerNameResolver; }
public void Execute() { var msCoreReferenceFinder = new ReferenceFinder { ModuleDefinition = ModuleDefinition, AssemblyResolver = AssemblyResolver }; msCoreReferenceFinder.Execute(); var interceptorFinder = new InterceptorFinder { ModuleDefinition = ModuleDefinition }; interceptorFinder.Execute(); var methodProcessor = new MethodProcessor { referenceFinder = msCoreReferenceFinder, typeSystem = ModuleDefinition.TypeSystem, InterceptorFinder = interceptorFinder, }; foreach (var typeDefinition in ModuleDefinition.GetTypes()) { if (typeDefinition.ContainsTimeAttribute()) { methodProcessor.Process(typeDefinition.Methods.Where(x => !x.IsAbstract)); continue; } foreach (var method in typeDefinition.Methods) { if (method.IsAbstract) { continue; } if (!method.ContainsTimeAttribute()) { continue; } methodProcessor.Process(method); } } }