Browse Source

Include namespaces of all known types used by the decompiler in the required namespaces super-set.

pull/1505/head
Siegfried Pammer 6 years ago
parent
commit
59b7e0c986
  1. 5
      ICSharpCode.Decompiler/CSharp/RequiredNamespaceCollector.cs

5
ICSharpCode.Decompiler/CSharp/RequiredNamespaceCollector.cs

@ -21,6 +21,11 @@ namespace ICSharpCode.Decompiler.CSharp @@ -21,6 +21,11 @@ namespace ICSharpCode.Decompiler.CSharp
public RequiredNamespaceCollector(HashSet<string> namespaces)
{
this.namespaces = namespaces;
for (int i = 0; i < KnownTypeReference.KnownTypeCodeCount; i++) {
var ktr = KnownTypeReference.Get((KnownTypeCode)i);
if (ktr == null) continue;
namespaces.Add(ktr.Namespace);
}
}
public static void CollectNamespaces(MetadataModule module, HashSet<string> namespaces)

Loading…
Cancel
Save