public void DeleteAllFiles(string fileBasePath) { // method implemented by Jean-Michel 2008-07-31 // TODO: implement check whether versioning is enabled before calling this method // if we are keeping versions we should not delete the files if (FolderId == -1) { return; } ArrayList folders = new ArrayList(); ArrayList files = new ArrayList(); using (IDataReader reader = SharedFile.GetSharedFiles(ModuleId, FolderId)) { while (reader.Read()) { files.Add(Convert.ToInt32(reader["ItemID"])); } } using (IDataReader reader = SharedFileFolder.GetSharedFolders(ModuleId, FolderId)) { while (reader.Read()) { folders.Add(Convert.ToInt32(reader["FolderID"])); } } foreach (int id in files) { SharedFile sharedFile = new SharedFile(ModuleId, id); sharedFile.Delete(fileBasePath); } foreach (int id in folders) { SharedFileFolder folder = new SharedFileFolder(ModuleId, id); folder.DeleteAllFiles(fileBasePath); SharedFileFolder.DeleteSharedFileFolder(id); } }