Esempio n. 1
0
        private bool IsAllowedDrive(DrvInfo drive)
        {
            if (!drive.IsReady && !ShowUnreadyDrives)
            {
                return(false);
            }

            switch (drive.Type)
            {
            case System.IO.DriveType.CDRom:
                return(ShowCDRomDrives);

            case System.IO.DriveType.Fixed:
                return(ShowFixedDrives);

            case System.IO.DriveType.Network:
                return(ShowNetworkDrives);

            case System.IO.DriveType.NoRootDirectory:
                return(ShowNoRootDirectoryDrives);

            case System.IO.DriveType.Ram:
                return(ShowRamDrives);

            case System.IO.DriveType.Removable:
                return(ShowRamDrives);

            case System.IO.DriveType.Unknown:
                return(ShowUnknownDrives);

            default:
                throw new ArgumentOutOfRangeException("DriveType");
            }
        }
Esempio n. 2
0
        public override void LoadDrives()
        {
            List <DrvInfo> list = new List <DrvInfo>();

            foreach (DriveInfo item in DriveInfo.GetDrives())
            {
                DrvInfo folderInfo = new DrvInfo(Parent, item.Name, CalculateVolumeLabel(item), item.RootDirectory.Root.Name, item.DriveType, item.IsReady, true);
                list.Add(folderInfo);
            }
            Drives         = list.ToArray();
            IsDrivesLoaded = true;
        }
Esempio n. 3
0
 internal FileSystemInfo(FileSystemManager parent, string name, string path, bool loadDirectories = false, bool loadFiles = false)
 {
     Parent = parent;
     Name = name;
     Path = path;
     Drives = new DrvInfo[0];
     Directories = new FolderInfo[0];
     Files = new FiInfo[0];
     if (loadDirectories)
         LoadDirectories();
     if (loadFiles)
         LoadFiles();
 }
Esempio n. 4
0
 internal FileSystemInfo(FileSystemManager parent, string name, string path, bool loadDirectories = false, bool loadFiles = false)
 {
     Parent      = parent;
     Name        = name;
     Path        = path;
     Drives      = new DrvInfo[0];
     Directories = new FolderInfo[0];
     Files       = new FiInfo[0];
     if (loadDirectories)
     {
         LoadDirectories();
     }
     if (loadFiles)
     {
         LoadFiles();
     }
 }
Esempio n. 5
0
 internal DrvInfoRoot(FileSystemManager parent, string name, string path, bool loadDirectories = false, bool loadFiles = false) : base(parent, name, path, loadDirectories, loadFiles)
 {
     Drives = new DrvInfo[0];
 }
Esempio n. 6
0
 public override void LoadDrives()
 {
     List<DrvInfo> list = new List<DrvInfo>();
     foreach (DriveInfo item in DriveInfo.GetDrives())
     {
         DrvInfo folderInfo = new DrvInfo(Parent, item.Name, CalculateVolumeLabel(item), item.RootDirectory.Root.Name, item.DriveType, item.IsReady, true);
         list.Add(folderInfo);
     }
     Drives = list.ToArray();
     IsDrivesLoaded = true;
 }
 public virtual bool AllowShowDrive(DrvInfo drive)
 {
     return true;
 }
        private bool IsAllowedDrive(DrvInfo drive)
        {
            if (!drive.IsReady && !ShowUnreadyDrives)
                return false;

            switch (drive.Type)
            {
                case System.IO.DriveType.CDRom:
                    return ShowCDRomDrives;
                case System.IO.DriveType.Fixed:
                    return ShowFixedDrives;
                case System.IO.DriveType.Network:
                    return ShowNetworkDrives;
                case System.IO.DriveType.NoRootDirectory:
                    return ShowNoRootDirectoryDrives;
                case System.IO.DriveType.Ram:
                    return ShowRamDrives;
                case System.IO.DriveType.Removable:
                    return ShowRamDrives;
                case System.IO.DriveType.Unknown:
                    return ShowUnknownDrives;
                default:
                    throw new ArgumentOutOfRangeException("DriveType");
            }
        }
 public override bool AllowShowDrive(DrvInfo drive)
 {
     return IsAllowedDrive(drive);
 }
Esempio n. 10
0
 public override bool AllowShowDrive(DrvInfo drive)
 {
     return(IsAllowedDrive(drive));
 }
Esempio n. 11
0
 private int CalculateDriveImageIndexListView(DrvInfo item)
 {
     switch (item.Type)
     {
         case System.IO.DriveType.CDRom:
             return item.IsReady ? 4 : 5;
         case System.IO.DriveType.Network:
             return item.IsReady ? 6 : 7;
         default:
             return item.IsReady ? 2 : 3;
     }
 }
Esempio n. 12
0
 private int CalculateDriveImageIndexTreeView(DrvInfo item)
 {
     switch (item.Type)
     {
         case System.IO.DriveType.CDRom:
             return item.IsReady ? 8 : 9;
         case System.IO.DriveType.Network:
             return item.IsReady ? 10 : 11;
         default:
             return item.IsReady ? 6 : 7;
     }
 }
Esempio n. 13
0
 internal DrvInfoRoot(FileSystemManager parent, string name, string path, bool loadDirectories = false, bool loadFiles = false) : base(parent, name, path, loadDirectories, loadFiles)
 {
     Drives = new DrvInfo[0];
 }
Esempio n. 14
0
 public virtual bool AllowShowDrive(DrvInfo drive)
 {
     return(true);
 }