Exemplo n.º 1
0
 private void LoadCache()
 {
     if (!FileUtility.Exists(LastSessionPath) || (FolderTree =
                                                      FolderManagerSaveManager.LoadFolderTree(LastSessionPath, false)) == null)
     {
         NewFolderTree();
         return;
     }
     FolderManager.RepaintClients();
 }
Exemplo n.º 2
0
        public void LoadFolderTree(string path)
        {
            if (!FileUtility.Exists(path) || (FolderTree = FolderManagerSaveManager.LoadFolderTree(path, true)) ==
                null)
            {
                NewFolderTree();
                return;
            }
            OpenedCanvasPath = path;

            SaveCache();
            FolderManager.RepaintClients();
        }
Exemplo n.º 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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 6
0
 public void SaveFolderTree(string path)
 {
     FolderTree.TreeName = path;
     FolderManagerSaveManager.SaveFolderTree(path, FolderTree, true);
     FolderManager.RepaintClients();
 }