public BfCache(Dictionary <string, AssemblyTuple> nameToAssemblyTuple) { GetTypes(nameToAssemblyTuple); Assemblies.AddRange(new HashSet <BfAssembly>(_dictionary.Values)); var index = 0; while (index < Types.Count) { var bfType = Types[index]; if (bfType.Name != "<Module>") { bfType.Populate(); Methods.AddRange(bfType.Methods); Events.AddRange(bfType.Events); Fields.AddRange(bfType.Fields); } ++index; } // ReSharper disable once ForCanBeConvertedToForeach for (var i = 0; i < Types.Count; ++i) { Types[i].Methods.Distinct().ForEach(m => m.Populate()); } Types.Distinct().ForEach(bfType => bfType.Commit()); Types.Distinct().ForEach(bfType => { bfType.Methods.ForEach(m => m.Dispose()); bfType.Events.ForEach(m => m.Dispose()); bfType.Fields.ForEach(m => m.Dispose()); }); Assemblies.Distinct().ForEach(bfAssembly => bfAssembly.Dispose()); Delegates(); ReIndex(); }
internal void RemoveDuplicates() { Assemblies = Assemblies.Distinct().ToList(); Types = Types.Distinct().ToList(); }