Пример #1
0
 private void LoadCache()
 {
     if (!FileUtility.Exists(LastSessionPath) || (FolderTree =
                                                      FolderManagerSaveManager.LoadFolderTree(LastSessionPath, false)) == null)
     {
         NewFolderTree();
         return;
     }
     FolderManager.RepaintClients();
 }
Пример #2
0
        public void LoadFolderTree(string path)
        {
            if (!FileUtility.Exists(path) || (FolderTree = FolderManagerSaveManager.LoadFolderTree(path, true)) ==
                null)
            {
                NewFolderTree();
                return;
            }
            OpenedCanvasPath = path;

            SaveCache();
            FolderManager.RepaintClients();
        }
Пример #3
0
        private void SortIfNeeded(TreeViewItem root, IList <TreeViewItem> rows)
        {
            if (rows.Count <= 1)
            {
                return;
            }

            if (multiColumnHeader.sortedColumnIndex == -1)
            {
                return; // No column to sort for (just use the order the data are in)
            }
            // Sort the roots of the existing tree items
            SortByMultipleColumns();
            TreeToList(root, rows);
            Repaint();
            FolderManager.RepaintClients();
        }
Пример #4
0
        private static void CreateContextCallback(object userData)
        {
            var inputInfo = userData as FolderManagerInputInfo;

            if (inputInfo != null)
            {
                var sortedList = inputInfo.FolderTreeState.Cache.FolderTree.TreeElements;
                sortedList.Sort((e1, e2) => e1.Id.CompareTo(e2.Id));
                var lastID = sortedList[sortedList.Count - 1].Id + 1;

                var element = new FolderTreeElement("Folder Name", 0, lastID);
                inputInfo.FolderTreeState.Cache.FolderTree.AddElement(element);

                FolderManagerCallbacks.IssueOnAddElement(element);
            }
            FolderManager.RepaintClients();
        }
Пример #5
0
        public void Draw()
        {
            var inRect = DrawGroup(position, menuItems);

            while (groupToDraw != null && !close)
            {
                var group = groupToDraw;
                groupToDraw = null;
                if (group.group)
                {
                    if (DrawGroup(group.groupPos, group.subItems))
                    {
                        inRect = true;
                    }
                }
            }

            if (!inRect || close)
            {
                PopupManager.CurrentPopup = null;
            }
            FolderManager.RepaintClients();
        }
Пример #6
0
 public void SaveFolderTree(string path)
 {
     FolderTree.TreeName = path;
     FolderManagerSaveManager.SaveFolderTree(path, FolderTree, true);
     FolderManager.RepaintClients();
 }