void CheckMethod(Assembly lib, MethodInfo method) { MethodBody body = method.GetMethodBody(); if (body == null) { return; } byte[] data = body.GetILAsByteArray(); List <Instruction> all = InstructionProcessor.GetAll(data); foreach (Instruction ins in all) { if (ins.UsesMethod) { ResolveMethod(lib, method, ins); } if (ins.UsesField) { ResolveField(lib, method, ins); } if (ins.UsesType) { ResolveType(lib, method, ins); } } }
public void Init(string root) { this.root = root; //AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += ResolveAssembly; AppDomain.CurrentDomain.AssemblyResolve += ResolveAssembly; InstructionProcessor.InitCache(); }