Esempio n. 1
0
        void SetStorageStatus(DriveInfo drive)
        {
            string volumnName = string.IsNullOrEmpty(drive.VolumeLabel) ? NavigationPane.GetDriveType(drive.DriveType) : drive.VolumeLabel;

            lblTopStorageStatus.Text = String.Format(
                "[{0}] {1} free in {2}",
                volumnName,
                ShellInfoItem.GetBytesReadable(drive.TotalFreeSpace),
                ShellInfoItem.GetBytesReadable(drive.TotalSize));
        }
Esempio n. 2
0
 void NavigationPane_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     if (e.Button == System.Windows.Forms.MouseButtons.Left)
     {
         string path = navigationPane.SelectedNode.Tag.ToString();
         if (string.IsNullOrWhiteSpace(path) || NavigationPane.IsSpecialFolders(path))
         {
             return;
         }
         NavigationPane_Click(path);
     }
 }
Esempio n. 3
0
 public static DirectoryInfo[] GetSubDirectories(DirectoryInfo path)
 {
     DirectoryInfo[] subDirs = null;
     try
     {
         SetAccessFolderRule(path.FullName);
         subDirs = path.GetDirectories().Where(x => !NavigationPane.BannedAttrExists(x)).ToArray();
     }
     catch (System.UnauthorizedAccessException)
     {
         return(null);
     }
     return(subDirs);
 }
Esempio n. 4
0
 public static FileInfo[] GetSubFiles(DirectoryInfo path)
 {
     FileInfo[] subFiles = null;
     try
     {
         SetAccessFolderRule(path.FullName);
         subFiles = path.GetFiles().Where(x => !NavigationPane.BannedAttrExists(x)).ToArray();
     }
     catch (System.UnauthorizedAccessException)
     {
         MessageBox.Show("Access denied on file" + Environment.NewLine + path.FullName,
                         "Total Commander", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return(null);
     }
     return(subFiles);
 }