Ejemplo 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");
            }
        }
Ejemplo 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;
        }
Ejemplo 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();
 }
Ejemplo 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();
     }
 }
Ejemplo 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];
 }
Ejemplo 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;
 }
Ejemplo n.º 7
0
 public virtual bool AllowShowDrive(DrvInfo drive)
 {
     return true;
 }
Ejemplo n.º 8
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");
            }
        }
Ejemplo n.º 9
0
 public override bool AllowShowDrive(DrvInfo drive)
 {
     return IsAllowedDrive(drive);
 }
Ejemplo n.º 10
0
 public override bool AllowShowDrive(DrvInfo drive)
 {
     return(IsAllowedDrive(drive));
 }
Ejemplo 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;
     }
 }
Ejemplo 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;
     }
 }
Ejemplo 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];
 }
Ejemplo n.º 14
0
 public virtual bool AllowShowDrive(DrvInfo drive)
 {
     return(true);
 }