public Weaver(ModuleDefinition moduleDefinition) { _moduleDefinition = moduleDefinition; _substitutionMap = moduleDefinition.CreateSubstitutionMap(); _substitutes = new HashSet <TypeReference>(_substitutionMap.Values, TypeReferenceEqualityComparer.Default); _substitutionMap.CheckRecursions(_substitutes); _unmappedTypeErrors = _substitutionMap.GetUnmappedTypeErrors(); }
public Weaver([NotNull] ModuleDefinition moduleDefinition, Parameters defaultParameters) { _moduleDefinition = moduleDefinition; _defaultParameters = defaultParameters; var assemblySubstitutionMap = moduleDefinition.Assembly.CreateSubstitutionMap(defaultParameters); _substitutionMap = moduleDefinition.CreateSubstitutionMap(defaultParameters, assemblySubstitutionMap); var substitutes = new HashSet <TypeReference>(_substitutionMap.Values.Select(t => t.TargetType)); _substitutionMap.CheckRecursions(substitutes); _unmappedTypeErrors = _substitutionMap.GetUnmappedTypeErrors(); }