private void AddNode(NodeInfo nodeInfo, TreeNodeCollection nodes, TreeNode erbNode)
        {
            var node = new TreeNode();

            node.Tag  = nodeInfo;
            node.Text = nodeInfo.GetString(setting.LineSetting);
            if (nodeInfo.LineInfo.IsData)
            {
                if (!erbNode.Nodes.ContainsKey("PRINTDATA|" + nodeInfo.LineInfo.PrintDataLine + 1))
                {
                    var printNode = new TreeNode(currentLineSetting.GetLine(nodeInfo.LineInfo.PrintDataLine + 1, "PRINTDATA"));
                    printNode.Name = "PRINTDATA|" + nodeInfo.LineInfo.PrintDataLine + 1;
                    printNode.Tag  = PRINTDATA_TAG;
                    erbNode.Nodes.Add(printNode);
                }
                {
                    var printNode = erbNode.Nodes.Find("PRINTDATA|" + nodeInfo.LineInfo.PrintDataLine + 1, false)[0];
                    if (nodeInfo.LineInfo.IsList)
                    {
                        if (!printNode.Nodes.ContainsKey("DATALIST|" + nodeInfo.LineInfo.ListLine + 1))
                        {
                            var listNode = new TreeNode(currentLineSetting.GetLine(nodeInfo.LineInfo.ListLine + 1, "DATALIST"));
                            listNode.Name = "DATALIST|" + nodeInfo.LineInfo.ListLine + 1;
                            listNode.Tag  = LIST_TAG;
                            printNode.Nodes.Add(listNode);
                        }
                        {
                            var listNode = printNode.Nodes.Find("DATALIST|" + nodeInfo.LineInfo.ListLine + 1, false)[0];
                            listNode.Nodes.Add(node);
                        }
                    }
                    else
                    {
                        printNode.Nodes.Add(node);
                    }
                }
            }
            else
            {
                erbNode.Nodes.Add(node);
            }
        }
Beispiel #2
0
 public string GetString(LineSetting setting)
 {
     return(setting.GetLine(LineNo + 1, LineInfo.Str));
 }