private void CreateGenericsForTypes(ConfuserContext context, IEnumerable <TypeDef> types) { TypeService service = context.Registry.GetService <TypeService>(); foreach (TypeDef type in types) { if (type.Module.EntryPoint.DeclaringType != type) { service.AddScannedItem(new ScannedType(type)); context.CheckCancellation(); } } }
private void CreateGenericsForMethods(ConfuserContext context, IEnumerable <MethodDef> methods) { TypeService service = context.Registry.GetService <TypeService>(); foreach (MethodDef method in methods) { /* * context.Logger.DebugFormat("[{0}]", method.Name); * if (method.HasBody) { * foreach(var i in method.Body.Instructions) { * context.Logger.DebugFormat("{0} - {1} : {2}", i.OpCode, i?.Operand?.GetType().ToString() ?? "NULL", i.Operand); * } * }*/ if (method.Module.EntryPoint != method && !(method.HasOverrides || method.IsAbstract || method.IsConstructor || method.IsGetter)) { service.AddScannedItem(new ScannedMethod(service, method)); context.CheckCancellation(); } } }