Example #1
0
        public static ImmutableArray <OutlineElement> GetItems(GuiDescriptionSyntax syntaxRoot)
        {
            var outlineElement = OutlineBuilder.Build(syntaxRoot, detailed: true);

            if (outlineElement == null)
            {
                return(ImmutableArray <OutlineElement> .Empty);
            }

            return(outlineElement.Flatten());
        }
        public static OutlineElement Build(GuiDescriptionSyntax syntaxRoot, bool detailed)
        {
            if (syntaxRoot == null)
            {
                return(null);
            }

            var builder = new OutlineBuilder(detailed);

            // Startpunkt ist bisweilen immer der Container
            var container = syntaxRoot.DescendantNodes().OfType <ContainerSyntax>().FirstOrDefault();

            if (container == null)
            {
                return(null);
            }

            return(builder.Visit(container));
        }