public void enter(FSItem item) { if (browserControll.execute(enterID, item)) { FSItem newItem = FSScan.inDirectory(item.getParent, address + "\\" + item.getName); item.getFolder().clearChildren(); foreach (FSItem it in newItem.getFolder().getChildren) { item.getFolder().addItem(it); } drawInView(); } }
public bool paste(FSItem item) { string destinationPath = getFullPath(rootItem) + "\\" + item.getName; string sourcePath = getFullPath(item); if (item.getFolder() == null) { File.Copy(sourcePath, destinationPath); } else { Directory.CreateDirectory(destinationPath); //Now Create all of the directories foreach (string dirPath in Directory.GetDirectories(sourcePath, "*", SearchOption.AllDirectories)) { Directory.CreateDirectory(dirPath.Replace(sourcePath, destinationPath)); } //Copy all the files & Replaces any files with the same name foreach (string newPath in Directory.GetFiles(sourcePath, "*.*", SearchOption.AllDirectories)) { File.Copy(newPath, newPath.Replace(sourcePath, destinationPath), true); } } return(true); }
public long size(FSItem item) { Measured measured; if (item.getFolder() == null) { measured = item as Measured; } else { measured = new MDirectoryAdapter(item as MDirectory); } return(measured.getSize); }
public void delete(FSItem item) { if (browserControll.execute(deleteID, item, true)) { FSItem rootItem = FSScan.inDirectory(history.getRootItem.getParent, address); FSItem[] children = rootItem.getFolder().getChildren; history.getRootItem.getFolder().clearChildren(); foreach (FSItem it in children) { history.getRootItem.getFolder().addItem(it); } drawInView(); } }
public bool delete(FSItem item) { string fullPath = getFullPath(item); if (item.getFolder() != null) { if (!Directory.Exists(fullPath)) throw new DirectoryNotFoundException("Указанная папка не существует: " + item.getName); Directory.Delete(fullPath, true); } else { if (!File.Exists(fullPath)) throw new FileNotFoundException("Указанный файл не существует: " + item.getName , item.getName); File.Delete(fullPath); } return true; }
public bool enter(FSItem item) { if (item.getFolder() != null) { rootItem = item; return(true); } else { FSItem tmp = item; string path = tmp.getName; while (tmp.getParent != null) { path = tmp.getParent.getName.Trim('\\') + "\\" + path; tmp = tmp.getParent; } Process.Start(path); return(false); } }
public bool enter(FSItem item) { if (item.getFolder() != null) { rootItem = item; return true; } else { FSItem tmp = item; string path = tmp.getName; while (tmp.getParent != null) { path = tmp.getParent.getName.Trim('\\') + "\\" + path; tmp = tmp.getParent; } Process.Start(path); return false; } }
public bool delete(FSItem item) { string fullPath = getFullPath(item); if (item.getFolder() != null) { if (!Directory.Exists(fullPath)) { throw new DirectoryNotFoundException("Указанная папка не существует: " + item.getName); } Directory.Delete(fullPath, true); } else { if (!File.Exists(fullPath)) { throw new FileNotFoundException("Указанный файл не существует: " + item.getName, item.getName); } File.Delete(fullPath); } return(true); }
public bool paste(FSItem item) { string destinationPath = getFullPath(rootItem) + "\\" + item.getName; string sourcePath = getFullPath(item); if(item.getFolder() == null) File.Copy(sourcePath, destinationPath); else { Directory.CreateDirectory(destinationPath); //Now Create all of the directories foreach (string dirPath in Directory.GetDirectories(sourcePath, "*", SearchOption.AllDirectories)) Directory.CreateDirectory(dirPath.Replace(sourcePath, destinationPath)); //Copy all the files & Replaces any files with the same name foreach (string newPath in Directory.GetFiles(sourcePath, "*.*", SearchOption.AllDirectories)) File.Copy(newPath, newPath.Replace(sourcePath, destinationPath), true); } return true; }
public long size(FSItem item) { Measured measured; if (item.getFolder() == null) measured = item as Measured; else measured = new MDirectoryAdapter(item as MDirectory); return measured.getSize; }
public void enter(FSItem item) { if (browserControll.execute(enterID, item)) { FSItem newItem = FSScan.inDirectory(item.getParent, address + "\\" + item.getName); item.getFolder().clearChildren(); foreach (FSItem it in newItem.getFolder().getChildren) item.getFolder().addItem(it); drawInView(); } }