示例#1
0
文件: Program.cs 项目: kerwon/dlr
        private static void ReflectionEnumerate(IEnumerable <Assembly> assemblies)
        {
            var tree = new RNamespaceTree();

            foreach (var assembly in assemblies)
            {
                foreach (var module in assembly.GetModules(false))
                {
                    EnumerateExtensionMethods(module);
                    tree.Add(module);
                    ModuleEnumerated(null);
                }
            }

            Counter_Types +=
                (from ns in tree.GetAllNamespaces()
                 from t in ns.GetTypeDefs()
                 select 1).Count();
        }
示例#2
0
文件: Program.cs 项目: kerwon/dlr
        private static void Statistics(RNamespaceTree tree, bool dump)
        {
            var x =
                from ns in tree.GetAllNamespaces()
                let count = ns.GetTypeDefs().Count()
                            group ns by count into g
                            let gCount = g.Count()
                                         orderby g.Key descending
                                         select new { Size = g.Key, Count = gCount };

            foreach (var p in x)
            {
                if (dump)
                {
                    _output.WriteLine("{0}\t{1}", p.Size, p.Count);
                }
            }

            Counter_Types = x.Sum((a) => a.Size);
            if (dump)
            {
                _output.WriteLine("Namespace size: total {0}, avg {1}", Counter_Types, x.Average((a) => a.Size));
            }
        }
示例#3
0
文件: Program.cs 项目: TerabyteX/main
        private static void Statistics(RNamespaceTree tree, bool dump)
        {
            var x =
                from ns in tree.GetAllNamespaces()
                let count = ns.GetTypeDefs().Count()
                group ns by count into g
                let gCount = g.Count()
                orderby g.Key descending
                select new { Size = g.Key, Count = gCount };

            foreach (var p in x) {
                if (dump) {
                    _output.WriteLine("{0}\t{1}", p.Size, p.Count);
                }
            }

            Counter_Types = x.Sum((a) => a.Size);
            if (dump) {
                _output.WriteLine("Namespace size: total {0}, avg {1}", Counter_Types, x.Average((a) => a.Size));
            }
        }
示例#4
0
文件: Program.cs 项目: TerabyteX/main
        private static void ReflectionEnumerate(IEnumerable<Assembly> assemblies)
        {
            var tree = new RNamespaceTree();
            foreach (var assembly in assemblies) {
                foreach (var module in assembly.GetModules(false)) {
                    EnumerateExtensionMethods(module);
                    tree.Add(module);
                    ModuleEnumerated(null);
                }
            }

            Counter_Types +=
                (from ns in tree.GetAllNamespaces()
                 from t in ns.GetTypeDefs()
                 select 1).Count();
        }