public MethodContext(Type type, Property method, PropertyDefinition methodDefinition) { Type = type; Property = method; PropertyDefinition = methodDefinition; Marker = new MethodMarker(); NameAlias = new NameAliasFactory(); Importer = new ImporterFactory(this); Cloning = new MethodCloneFactory(this); Mixin = new MethodMixinExtension(this); Scope = new MethodScopingExtension(this); Assemblies = new AssemblyFactory(); }
private void CloneMethodParameters(MethodReference sourceMethod, MethodReference clonedMethod) { if (sourceMethod.HasParameters) { var importer = new ImporterFactory(context); foreach (var parameter in sourceMethod.Parameters.ToList()) { var importedParameterType = importer.Import(parameter.ParameterType); var parameterDef = new ParameterDefinition( parameter.Name, parameter.Attributes, importedParameterType); clonedMethod.Parameters.Add(parameterDef); } } }