Пример #1
0
 public static TreeStatus Save(TreeViewItem treeViewItem)
 {
     if (treeViewItem == null) return null;
     TreeStatus status = new TreeStatus(treeViewItem);
     SaveStatus(treeViewItem, status);
     return status;
 }
Пример #2
0
        public static TreeStatus Save(TreeViewItem treeViewItem)
        {
            if (treeViewItem == null)
            {
                return(null);
            }
            TreeStatus status = new TreeStatus(treeViewItem);

            SaveStatus(treeViewItem, status);
            return(status);
        }
Пример #3
0
 public static void Restore(TreeViewItem treeViewItem, TreeStatus treeStatus)
 {
     treeViewItem.IsExpanded = treeStatus.IsExpanded;
     for (int x = 0; x < treeStatus.StatusList.Length; x++)
     {
         TreeViewItem t = treeViewItem.Items[x] as TreeViewItem;
         if (t != null)
         {
             t.IsExpanded = treeStatus.StatusList[x].IsExpanded;
             Restore(t, treeStatus.StatusList[x]);
         }
     }
 }
Пример #4
0
 public static void Restore(TreeViewItem treeViewItem, TreeStatus treeStatus)
 {
     treeViewItem.IsExpanded = treeStatus.IsExpanded;
     for (int x = 0; x < treeStatus.StatusList.Length; x++)
     {
         TreeViewItem t = treeViewItem.Items[x] as TreeViewItem;
         if (t != null)
         {
             t.IsExpanded = treeStatus.StatusList[x].IsExpanded;
             Restore(t, treeStatus.StatusList[x]);
         }
     }
 }
Пример #5
0
 private static void SaveStatus(TreeViewItem treeViewItem, TreeStatus treeStatus)
 {
     treeStatus.IsExpanded = treeViewItem.IsExpanded;
     for (int x = 0; x < treeViewItem.Items.Count; x++)
     {
         TreeViewItem t = treeViewItem.Items[x] as TreeViewItem;
         if (t != null)
         {
             TreeStatus ts = new TreeStatus(t);
             treeStatus.StatusList[x] = ts;
             SaveStatus(t, ts);
         }
     }
 }
Пример #6
0
 private static void SaveStatus(TreeViewItem treeViewItem, TreeStatus treeStatus)
 {
     treeStatus.IsExpanded = treeViewItem.IsExpanded;
     for (int x = 0; x < treeViewItem.Items.Count; x++)
     {
         TreeViewItem t = treeViewItem.Items[x] as TreeViewItem;
         if (t != null)
         {
             TreeStatus ts = new TreeStatus(t);
             treeStatus.StatusList[x] = ts;
             SaveStatus(t, ts);
         }
     }
 }