Example #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);

            return(new IUnit[] { assemblyUnit }
                   .Concat(new[] { tableOfContents })
                   .Concat(memberUnits));
        }
Example #2
0
        private static IEnumerable <IUnit> ToUnits(XDocument document, XElement docElement)
        {
            var assemblyNode = docElement.Element("assembly");
            var au           = new AssemblyUnit(document, assemblyNode);

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

            memberUnits.Insert(0, au);

            return(memberUnits.ToArray());
        }
Example #3
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);
        }