Ejemplo n.º 1
0
 public ExpandInfo(TreeNodeCollection nodes, string fileName, int sourceId)
 {
     FileName = fileName;
     SourceId = sourceId;
     root     = new ExpandInfoChild();
     Check(nodes, root);
 }
Ejemplo n.º 2
0
 private void Check(TreeNodeCollection nodes, ExpandInfoChild info)
 {
     foreach (TreeNode childNode in nodes)
     {
         var child = new ExpandInfoChild
         {
             IsExpanded = childNode.IsExpanded
         };
         info.Add(child);
         Check(childNode.Nodes, child);
     }
 }
Ejemplo n.º 3
0
 private void Restore(TreeNodeCollection nodes, ExpandInfoChild info)
 {
     for (int i = 0; i < Math.Min(nodes.Count, info.ChildrenCount); i++)
     {
         if (info.Children[i].IsExpanded)
         {
             nodes[i].Expand();
         }
         else
         {
             nodes[i].Collapse();
         }
         Restore(nodes[i].Nodes, info.Children[i]);
     }
 }
Ejemplo n.º 4
0
 public void Add(ExpandInfoChild child)
 {
     children.Add(child);
 }