Example #1
0
        private static IEnumerable <Argument> GetArguments(IEnumerable <ParseTreeNode> nodes)
        {
            foreach (var node in nodes)
            {
                var argument =
                    PositionalArgument.Create(node)
                    ?? (Argument)NamedArgument.Create(node);

                if (argument != null)
                {
                    yield return(argument);
                }
                else
                {
                    // Unwrap argument
                    foreach (var markupExtensionArgument in GetArguments(node.ChildNodes))
                    {
                        yield return(markupExtensionArgument);
                    }
                }
            }
        }
 private IEnumerable<string> Format(NamedArgument namedArgument)
 {
     return Format($"{namedArgument.Name}=", Format(namedArgument.Value));
 }