예제 #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);
         }
     }
 }