Example #1
0
    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()));
    }
Example #2
0
    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());
    }
Example #3
0
 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)
     });
 }
Example #4
0
 public override void CreateFolder(FileManagerFolder parent, string name)
 {
     ArtsDataProvider.InsertArt(new ArtsFileSystemItem
     {
         IsFolder      = true,
         LastWriteTime = DateTime.Now,
         Name          = name,
         ParentID      = FindArtsFolderItem(parent).ArtID
     });
     RefreshFolderCache();
 }
Example #5
0
 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();
 }
Example #6
0
 public override void DeleteFolder(FileManagerFolder folder)
 {
     ArtsDataProvider.DeleteArt(FindArtsFolderItem(folder));
     RefreshFolderCache();
 }
Example #7
0
 public override void DeleteFile(FileManagerFile file)
 {
     ArtsDataProvider.DeleteArt(FindArtsFileItem(file));
 }
Example #8
0
 public override void MoveFolder(FileManagerFolder folder, FileManagerFolder newParentFolder)
 {
     ArtsDataProvider.UpdateArt(FindArtsFolderItem(folder), artItem => artItem.ParentID = FindArtsFolderItem(newParentFolder).ArtID);
     RefreshFolderCache();
 }
Example #9
0
 public override void MoveFile(FileManagerFile file, FileManagerFolder newParentFolder)
 {
     ArtsDataProvider.UpdateArt(FindArtsFileItem(file), artItem => artItem.ParentID = FindArtsFolderItem(newParentFolder).ArtID);
 }
Example #10
0
 public override void RenameFolder(FileManagerFolder folder, string name)
 {
     ArtsDataProvider.UpdateArt(FindArtsFolderItem(folder), artItem => artItem.Name = name);
     RefreshFolderCache();
 }
Example #11
0
 public override void RenameFile(FileManagerFile file, string name)
 {
     ArtsDataProvider.UpdateArt(FindArtsFileItem(file), artItem => artItem.Name = name);
 }