Create() public static method

public static Create ( ParseTreeNode node ) : MarkupExtension
node ParseTreeNode
return MarkupExtension
        public bool TryParse(string sourceText, out MarkupExtension graph)
        {
            graph = null;

            try
            {
                ParseTree tree = _parser.Parse(sourceText);
#if DEBUG
                // Save result tree for debugging purposes
                LastParseTree = tree;
                LastException = null;
#endif
                if (tree.Status == ParseTreeStatus.Parsed)
                {
                    graph = MarkupExtension.Create(tree.Root);
                    return(true);
                }
            }
#if DEBUG
            catch (Exception ex)
            {
                LastParseTree = null;
                LastException = ex;
            }
#else
            catch
            {
                // ignored
            }
#endif
            return(false);
        }
示例#2
0
 public static Value Create(ParseTreeNode node)
 {
     return(LiteralValue.Create(node)
            ?? (Value)MarkupExtension.Create(node));
 }