public static IEnumerable <AssemblyDefinition> ResolveAssemblyReferences(AssemblyDefinition assembly)
 {
     return(MonoAssemblyStripping.ResolveAssemblyReferences(assembly.MainModule.AssemblyResolver, assembly.MainModule.AssemblyReferences));
 }
        private static HashSet <AssemblyDefinition> CollectAssembliesRecursive(IEnumerable <AssemblyDefinition> assemblies)
        {
            HashSet <AssemblyDefinition> hashSet = new HashSet <AssemblyDefinition>(assemblies, new MonoAssemblyStripping.AssemblyDefinitionComparer());
            int num = 0;

            while (hashSet.Count > num)
            {
                num = hashSet.Count;
                hashSet.UnionWith(hashSet.ToArray <AssemblyDefinition>().SelectMany((AssemblyDefinition a) => MonoAssemblyStripping.ResolveAssemblyReferences(a)));
            }
            return(hashSet);
        }