コード例 #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();
        }