Пример #1
0
        private static IEnumerable<IUnit> ToUnits(XElement docElement)
        {
            // assembly unit
            var assemblyUnit = new AssemblyUnit(docElement.Element("assembly"));

            // member units
            var memberUnits = docElement
                .Element("members")
                .Elements("member")
                .Select(element => new MemberUnit(element))
                .Where(member => member.Kind != MemberKind.NotSupported)
                .GroupBy(unit => unit.TypeName)
                .Select(MemberUnit.ComplementType)
                .SelectMany(group => group)
                .OrderBy(member => member, MemberUnit.Comparer);

            // table of contents
            var tableOfContents = new TableOfContents(memberUnits);

            return new IUnit[] { tableOfContents }
                .Concat(new[] { assemblyUnit })
                .Concat(memberUnits);
        }
Пример #2
0
        private static IEnumerable <IUnit> ToUnits(XElement docElement)
        {
            // assembly unit
            var assemblyUnit = new AssemblyUnit(docElement.Element("assembly"));

            // member units
            var memberUnits = docElement
                              .Element("members")
                              .Elements("member")
                              .Select(element => new MemberUnit(element))
                              .Where(member => member.Kind != MemberKind.NotSupported)
                              .GroupBy(unit => unit.TypeName)
                              .Select(MemberUnit.ComplementType)
                              .SelectMany(group => group)
                              .OrderBy(member => member, MemberUnit.Comparer);

            // table of contents
            var tableOfContents = new TableOfContents(memberUnits);

            return(new IUnit[] { tableOfContents }
                   .Concat(new[] { assemblyUnit })
                   .Concat(memberUnits));
        }