Example #1
0
 public ExpandInfo(TreeNodeCollection nodes, string fileName, int sourceId)
 {
     FileName = fileName;
     SourceId = sourceId;
     root     = new ExpandInfoChild();
     Check(nodes, root);
 }
Example #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);
     }
 }
Example #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]);
     }
 }
Example #4
0
 public void Add(ExpandInfoChild child)
 {
     children.Add(child);
 }