public override ParserElementBase CloneForParse(TextBuffer buffer) { var element = new Optional(ChildNodes.Select(r => ((ParserElementBase)r).CloneForParse(buffer)).ToArray());// { Parser = Parser }; element.TextBuffer = buffer; return(element); }
protected override object DoEvaluate(ScriptThread thread) { thread.CurrentNode = this; var result = ChildNodes.Select((node) => node.Evaluate(thread).ToString()).Aggregate((a, b) => a + "; " + b).ToString(); thread.CurrentNode = Parent; return(result); }
protected override object DoEvaluate(ScriptThread thread) { thread.CurrentNode = this; var result = ChildNodes.Select((node) => (Object.LpObject[])node.Evaluate(thread)).ToDictionary(pairs => pairs[0], pairs => pairs[1]); thread.CurrentNode = Parent; return(result); }
protected override object DoEvaluate(ScriptThread thread) { thread.CurrentNode = this; Object.LpObject[] result = ChildNodes.Select((node) => (Object.LpObject)node.Evaluate(thread)).ToArray(); thread.CurrentNode = Parent; return(result); }
protected override object DoEvaluate(ScriptThread thread) { thread.CurrentNode = this; var result = ChildNodes.Select((node) => { return((AstNode[])node.Evaluate(thread)); }).ToArray(); thread.CurrentNode = Parent; return(result); }
private void RootNode_SizeChanged(object sender, EventArgs e) { if (flowLayoutPanel.Controls.Count == 0) { return; } _childrenSize.Height = ChildNodes.Select(node => node.Size).Sum(size => size.Height); ApplyExpandedCollapsed(); }
public Size LayoutNode() { List <Size> childSizes = ChildNodes.Select(node => node.LayoutNode()).ToList(); _childrenSize.Height = childSizes.Sum(size => size.Height); _childrenSize.Width = childSizes.Max(size => size.Width); labelNodeName.Text = NodeName; ApplyExpandedCollapsed(); ChildNodes.ForEach(node => flowLayoutPanel.Controls.Add((UserControl)node)); return(Size); }
public override string ToString() { var attributeString = Attributes.Count == 0 ? "" : string.Join("", Attributes .Select(tuple => $" {tuple.Key}=\"{tuple.Value}\"")); var contentString = ChildNodes.Count == 0 ? "" : string.Join("", ChildNodes.Select(child => child.ToString())); return($"<{Tag}{attributeString}>{contentString}</{Tag}>"); }
public override string GenerateScript(LanguageOption options, int indentationlevel = 0) { if (token != null) { return(token.Text); } if (UoToken != null) { return(UoToken.Value); } return(string.Join(",", ChildNodes.Select( expression => string.Format(((ExpressionNode)expression).ChildNodes.Count == 0 ? "{0}" : "{1}{0}{2}", ((ExpressionNode)expression).GenerateScript(options), Punct.LPara, Punct.RPara) ))); }
/// <summary> /// Copies an existing sitemap node and all properties /// </summary> /// <param name="node"></param> /// <returns></returns> public SiteMapNode Copy() { return(new SiteMapNode { Action = Action, Area = Area, Attributes = new Dictionary <string, object>(Attributes), ChildNodes = ChildNodes.Select(n => n.Copy()).ToList(), Clickable = Clickable, Controller = Controller, Description = Description, DynamicNodeProvider = DynamicNodeProvider, HttpMethod = HttpMethod, ImageUrl = ImageUrl, Key = Key, Order = Order, TargetFrame = TargetFrame, Title = Title, Url = Url, UnresolvedUrl = UnresolvedUrl }); }
public int GetMetadataSum() { return(Metadata.DefaultIfEmpty().Sum() + ChildNodes.Select(o => o.GetMetadataSum()).DefaultIfEmpty().Sum()); }
public void ExpandAll(bool expanded) { Expanded = expanded; ChildNodes.Select(node => node as IRootNode).Where(node => node != null).ToList().ForEach(node => node.ExpandAll(expanded)); }
protected ParserElementBase[] CloneSubElementsForParse(TextBuffer buffer) { return(ChildNodes.Select(r => r.CloneForParse(buffer)).ToArray()); }
public override string GetGrammar() { string Grammar = string.Join(" ", ChildNodes.Select(s => s.GetGrammar()).ToArray()); return(Grammar); }
public override string GenerateScript(LanguageOption options, int indentationlevel = 0) { return(GenerateBlock(ChildNodes.Select(node => node as IStatement).ToArray(), options, indentationlevel)); }