internal void DeleteFile(CFile fileToDelete) { int fileCount = this.MedFolder.FileCount; for (int i = 1; i <= fileCount; i++) { IFolderFile folderFile = this.MedFolder.GetFile(i) as IFolderFile; if (folderFile.Name == fileToDelete.Name) { this.MedFolder.DeleteFolderFile(i); break; } } this.Remove(fileToDelete); }
public CFile CreateFile(string name) { IFolderFile medFolderFile = this.MedFolder.CreateFileDirect(name) as IFolderFile; CFile cFile; if (base.Parent is CFileSystem) { cFile = new CFile((base.Parent as CFileSystem).RootFolder.Files, medFolderFile, true); } else { cFile = new CFile(((base.Parent as CFolders).Parent as CFolder).Files, medFolderFile, true); } this.Files.AddLast(cFile); return(cFile); }