コード例 #1
0
 public static NamespaceHierarchyTree BuildNamespaceHierarchyTree(this AssemblyDefinition self)
 {
     V_0 = new HashSet <string>();
     V_1 = self.get_Modules().GetEnumerator();
     try
     {
         while (V_1.MoveNext())
         {
             V_2 = V_1.get_Current().get_Types().GetEnumerator();
             try
             {
                 while (V_2.MoveNext())
                 {
                     V_3 = V_2.get_Current();
                     if (String.op_Equality(V_3.get_Namespace(), String.Empty) && String.op_Equality(V_3.get_Name(), "<Module>"))
                     {
                         continue;
                     }
                     dummyVar0 = V_0.Add(V_3.get_Namespace());
                 }
             }
             finally
             {
                 V_2.Dispose();
             }
         }
     }
     finally
     {
         V_1.Dispose();
     }
     return(NamespaceHierarchyTreeBuilder.BuildTree(V_0));
 }
コード例 #2
0
        public static NamespaceHierarchyTree BuildNamespaceHierarchyTree(this AssemblyDefinition self)
        {
            HashSet <string> namespaces = new HashSet <string>();

            foreach (ModuleDefinition module in self.Modules)
            {
                foreach (TypeDefinition typeDef in module.Types)
                {
                    if (typeDef.Namespace == string.Empty && typeDef.Name == "<Module>")
                    {
                        continue;
                    }
                    namespaces.Add(typeDef.Namespace);
                }
            }

            return(NamespaceHierarchyTreeBuilder.BuildTree(namespaces));
        }