Esempio n. 1
0
        /// <summary>
        /// Prepares the <see cref="AssemblyMemberBuilder"/> from the <paramref name="symbol"/>
        /// and adds it to <see cref="RootMember.Assemblies"/>
        /// </summary>
        /// <param name="symbol">Source <see cref="IAssemblySymbol"/></param>
        /// <param name="root">Builder root</param>
        /// <param name="level">Hierarchy level (used to indent the console output)</param>
        private static void BuildAssembly(IAssemblySymbol symbol, RootMemberBuilder root, int level)
        {
            var a = new AssemblyMemberBuilder
            {
                Name             = symbol.Name,
                NameBase         = symbol.Name,
                Symbol           = symbol,
                DocumentationId  = symbol.GetDocumentationCommentId(),
                DocumentationXml = symbol.GetDocumentationCommentXml()
            };

            root.Assemblies.Add(a);
            Console.WriteLine($"{new string(' ', level)} read as {a}");
            // ReSharper disable once TailRecursiveCall
            Build(symbol.GlobalNamespace, root, a, null, null, level + 1);
        }