Beispiel #1
0
        private void FileView_AfterSelect(object sender, TreeViewEventArgs e)
        {
            TreeNode node       = fileView.SelectedNode;
            string   pathToFile = GetFullPath(node);
            //FSObjectStatus fos = adbFM.GetFSObjectStatus(pathToFile, inRoot);
            FSObjectStatus fos = GetFSObjectStatusWithCache(pathToFile);

            if (fos == FSObjectStatus.PermissionDenied)    // Permission Denied.
            {
                node.Text += pathToFile.Contains(PERM_HINT_WORDS) ? "" : PERM_HINT_WORDS;
                return;
            }

            if (fos == FSObjectStatus.File)
            {
                return;
            }

            if (node.Nodes.Count != 0)
            {
                node.Nodes.Clear();
            }

            foreach (string s in ListFilesWithCache(pathToFile))
            {
                node.Nodes.Add(s);
            }
        }
Beispiel #2
0
 private FSObjectStatus GetFSObjectStatusWithCache(string path)
 {
     if (objStatusCache.ContainsKey(path))
     {
         return(objStatusCache[path]);
     }
     else
     {
         FSObjectStatus s = adbFM.GetFSObjectStatus(path, inRoot);
         objStatusCache.Add(path, s);
         return(s);
     }
 }