示例#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");
            }
        }
示例#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;
        }
示例#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();
 }
示例#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();
     }
 }
示例#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];
 }
示例#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);
 }
示例#10
0
 public override bool AllowShowDrive(DrvInfo drive)
 {
     return(IsAllowedDrive(drive));
 }
示例#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;
     }
 }
示例#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;
     }
 }
示例#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];
 }
示例#14
0
 public virtual bool AllowShowDrive(DrvInfo drive)
 {
     return(true);
 }