Exemplo n.º 1
0
 private void CreateTree(SQMTreeNode rootnode)
 {
     foreach (var data in Parser.Children)
     {
         SQMTreeNode node = ProcessChild(data,rootnode);
         if (rootnode != null)
         {
             rootnode.Nodes.Add(node);
         }
         else
         {
             NodesView.Nodes.Add(node);
         }
     }
 }
Exemplo n.º 2
0
 private static SQMTreeNode ProcessChild(NodeData data,SQMTreeNode rootnode)
 {
     SQMTreeNode node = new SQMTreeNode(data.ToString(), data);
     foreach (var atr in data.Atributes.Keys)
     {
         var value = data.Atributes[atr];
         if (value.GetType().IsGenericType)
         {
             value = value[0];
         }
         SQMTreeNode childnode = new SQMTreeNode(atr, data, atr);
         childnode.Text = childnode.ToString();
         childnode.Tag = node;
         node.Nodes.Add(childnode);
     }
     foreach (var child in data.Children)
     {
         SQMTreeNode childnode = ProcessChild(child, node);
         node.Nodes.Add(childnode);
     }
     return node;
 }