public override void DeleteContent(int moduleId, Guid moduleGuid) { if (SharedFilesConfiguration.DeleteFilesOnModuleDelete) { try { SiteSettings siteSettings = CacheHelper.GetCurrentSiteSettings(); if (siteSettings != null) { string fileVirtualBasePath = "~/Data/Sites/" + siteSettings.SiteId.ToInvariantString() + "/SharedFiles/"; FileSystemProvider p = FileSystemManager.Providers[WebConfigSettings.FileSystemProvider]; if (p != null) { IFileSystem fileSystem = p.GetFileSystem(); if (fileSystem != null) { using (IDataReader reader = SharedFile.GetHistoryByModule(moduleId)) { while (reader.Read()) { string fileName = reader["ServerFileName"].ToString(); fileSystem.DeleteFile(VirtualPathUtility.Combine(fileVirtualBasePath + "History/", fileName)); } } using (IDataReader reader = SharedFile.GetSharedFiles(moduleId)) { while (reader.Read()) { string fileName = reader["ServerFileName"].ToString(); fileSystem.DeleteFile(VirtualPathUtility.Combine(fileVirtualBasePath, fileName)); } } } } } } catch (Exception ex) { log.Error(ex); } } SharedFile.DeleteByModule(moduleId); }
public override void DeleteContent(int moduleId, Guid moduleGuid) { SharedFile.DeleteByModule(moduleId); }