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 override IEnumerable <IDirectoryViewItem> GetDirectoryContent(string path) { DirectoryInfo di = new DirectoryInfo(path); FileSystemInfo[] infos = di.GetFileSystemInfos(); int lengthWithoutHidden = infos.Count(inf => (inf.Attributes & FileAttributes.Hidden) != FileAttributes.Hidden); int addUp = Convert.ToInt32(!PathExt.IsDriveRoot(path)); IDirectoryViewItem[] adapters = new IDirectoryViewItem[lengthWithoutHidden + addUp]; if (addUp == 1) { adapters[0] = new MoveUpObject(); } int i = addUp; foreach (FileSystemInfo info in infos) { if ((info.Attributes & FileAttributes.Hidden) != FileAttributes.Hidden) { adapters[i] = new WindowsFile(info); i++; } } CurrentPlace = new WindowsFile(di); return(adapters.Cast <IDirectoryViewItem>()); }
public void Upload(WindowsFile file) { connection.UploadFile(file.FullName, file.Name); }
public override IEnumerable<IDirectoryViewItem> GetDirectoryContent(string path) { DirectoryInfo di = new DirectoryInfo(path); FileSystemInfo[] infos = di.GetFileSystemInfos(); int lengthWithoutHidden = infos.Count(inf => (inf.Attributes & FileAttributes.Hidden) != FileAttributes.Hidden); int addUp = Convert.ToInt32(!PathExt.IsDriveRoot(path)); IDirectoryViewItem[] adapters = new IDirectoryViewItem[lengthWithoutHidden + addUp]; if (addUp == 1) adapters[0] = new MoveUpObject(); int i = addUp; foreach (FileSystemInfo info in infos) { if ((info.Attributes & FileAttributes.Hidden) != FileAttributes.Hidden) { adapters[i] = new WindowsFile(info); i++; } } CurrentPlace = new WindowsFile(di); return adapters.Cast<IDirectoryViewItem>(); }
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); }