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 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; }
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(); }
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(); } }
internal DrvInfoRoot(FileSystemManager parent, string name, string path, bool loadDirectories = false, bool loadFiles = false) : base(parent, name, path, loadDirectories, loadFiles) { Drives = new DrvInfo[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); }
public override bool AllowShowDrive(DrvInfo drive) { return(IsAllowedDrive(drive)); }
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; } }
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; } }
public virtual bool AllowShowDrive(DrvInfo drive) { return(true); }