Walk() abstract private méthode

abstract private Walk ( NodeWalker walker, int depth, bool wrap ) : void
walker NodeWalker
depth int
wrap bool
Résultat void
 private static void GetSimpleFormatString(Node constantNode, List<NodeInfo> nodeInfos, StringBuilder textLine)
 {
     constantNode.Walk((text, value, depth) =>
                           {
                               if (value != null)
                               {
                                   nodeInfos.Add(new NodeInfo { Location = textLine.Length, Value = value, Depth=depth });
                               }
                               textLine.Append(text);
                           }, 0);
 }
        internal static string[] Format(Node constantNode)
        {
            StringBuilder textLine = new StringBuilder();
            List<NodeInfo> nodeInfos = new List<NodeInfo>();

            constantNode.Walk((text, value, depth) =>
                          {
                              if (value != null)
                              {
                                  nodeInfos.Add(new NodeInfo { Location = textLine.Length, Value = value, Depth=depth });
                              }
                              textLine.Append(text);
                          }, 0);

            List<StringBuilder> lines = new List<StringBuilder>();

            List<int> stalks = new List<int>();
            foreach (var info in nodeInfos.OrderBy(x => x.Location))
            {
                var line = new StringBuilder(new string(' ', info.Location));
                stalks.ForEach(x => line[x] = pipe);
                stalks.Add(info.Location);
                line.Append(info.Value);
                lines.Add(line);
            }

            if(nodeInfos.Any())
            {
                for (int i = nodeInfos.Max(x=>x.Depth)-1; i >= 0 ; i--)
                {
                    var line = new StringBuilder(new string(' ', nodeInfos.Max(x=>x.Location)+1));
                    nodeInfos.ForEach(x => line[x.Location] = x.Depth > i ? dot : pipe);
                    lines.Add(line);
                }
            }

            lines.Add(textLine);

            return lines
                .AsEnumerable()
                .Reverse()
                .Select(x => x.ToString().TrimEnd())
                .Where(x=>x.Length > 0)
                .ToArray();
        }
        static StringBuilder PrettyPrint(Node constantNode, out List<NodeInfo> outNodeInfos)
        {
            StringBuilder textLine = new StringBuilder();
            var nodeInfos = new List<NodeInfo>();

            constantNode.Walk((text, value, depth) =>
            {
                if (value != null)
                {
                    nodeInfos.Add(new NodeInfo {Location = textLine.Length, Width = text.Length, Value = value, Depth = depth});
                }
                textLine.Append(text);
            }, 0, false);

            outNodeInfos = nodeInfos;
            return textLine;
        }