public override void LoadDirectory(string path) { Items.Clear(); DirectoryInfo di = new DirectoryInfo(path); FileSystemInfo[] infos = di.GetFileSystemInfos(); int addUp = Convert.ToInt32(!PathExt.IsDriveRoot(path)); if (addUp == 1) { Items.Add(new MoveUpObject()); } foreach (FileSystemInfo info in infos) { if ((info.Attributes & FileAttributes.Hidden) != FileAttributes.Hidden)//OPTIONS: Show hidden files { Items.Add(new WindowsFile(info)); } } CurrentPlace = new WindowsFile(di); //check if drive has changed if (Root == null || Path.GetPathRoot(FullPath) != Root.Path) { Root = new WindowsDrive(DriveLetter); } }
public WindowsFileSystem(string directory) { Root = new WindowsDrive(PathExt.GetDriveLetter(directory)); LoadDirectory(directory); }
public void InitializeAfterDeserialization(StreamingContext context) { Root = new WindowsDrive(PathExt.GetDriveLetter(CurrentPlace.FullName)); LoadDirectory(CurrentPlace.FullName); }