public override IEnumerable <FileManagerFile> GetFiles(FileManagerFolder folder) { ArtsFileSystemItem artFolderItem = FindArtsFolderItem(folder); return(from artItem in ArtsDataProvider.GetArts() where !artItem.IsFolder && artItem.ParentID == artFolderItem.ArtID select new FileManagerFile(this, folder, artItem.Name, artItem.ArtID.ToString())); }
protected ArtsFileSystemItem FindArtsFileItem(FileManagerFile file) { ArtsFileSystemItem artsFolderItem = FindArtsFolderItem(file.Folder); if (artsFolderItem == null) { return(null); } return(ArtsDataProvider.GetArts().FindAll(item => (int)item.ParentID == artsFolderItem.ArtID && !item.IsFolder && item.Name == file.Name).FirstOrDefault()); }
public override void UploadFile(FileManagerFolder folder, string fileName, Stream content) { ArtsDataProvider.InsertArt(new ArtsFileSystemItem { IsFolder = false, LastWriteTime = DateTime.Now, Name = fileName, ParentID = FindArtsFolderItem(folder).ArtID, Data = ReadAllBytes(content) }); }
public override void CreateFolder(FileManagerFolder parent, string name) { ArtsDataProvider.InsertArt(new ArtsFileSystemItem { IsFolder = true, LastWriteTime = DateTime.Now, Name = name, ParentID = FindArtsFolderItem(parent).ArtID }); RefreshFolderCache(); }
protected void RefreshFolderCache() { this.folderCache = ArtsDataProvider.GetArts().FindAll(artItem => artItem.IsFolder).ToDictionary(artItem => artItem.ArtID); this.rootFolderDisplayName = (from artFolderItem in FolderCache.Values where artFolderItem.ArtID == ArtsRootItemID select artFolderItem.Name).First(); }
public override void DeleteFolder(FileManagerFolder folder) { ArtsDataProvider.DeleteArt(FindArtsFolderItem(folder)); RefreshFolderCache(); }
public override void DeleteFile(FileManagerFile file) { ArtsDataProvider.DeleteArt(FindArtsFileItem(file)); }
public override void MoveFolder(FileManagerFolder folder, FileManagerFolder newParentFolder) { ArtsDataProvider.UpdateArt(FindArtsFolderItem(folder), artItem => artItem.ParentID = FindArtsFolderItem(newParentFolder).ArtID); RefreshFolderCache(); }
public override void MoveFile(FileManagerFile file, FileManagerFolder newParentFolder) { ArtsDataProvider.UpdateArt(FindArtsFileItem(file), artItem => artItem.ParentID = FindArtsFolderItem(newParentFolder).ArtID); }
public override void RenameFolder(FileManagerFolder folder, string name) { ArtsDataProvider.UpdateArt(FindArtsFolderItem(folder), artItem => artItem.Name = name); RefreshFolderCache(); }
public override void RenameFile(FileManagerFile file, string name) { ArtsDataProvider.UpdateArt(FindArtsFileItem(file), artItem => artItem.Name = name); }