Ejemplo n.º 1
0
        protected FileSystemItem FindFileItem(FileManagerFile file)
        {
            FileSystemItem fileItem = FindFolderItem(file.Folder);

            if (fileItem == null)
            {
                return(null);
            }
            return(ProcessBlueprintDataProvider.GetAll().FindAll(item => (int)item.ParentId == fileItem.FileId && !item.IsFolder && item.Name == file.Name).FirstOrDefault());
        }
Ejemplo n.º 2
0
 public override void CopyFolder(FileManagerFolder folder, FileManagerFolder newParentFolder)
 {
     ProcessBlueprintDataProvider.Insert(new FileSystemItem
     {
         IsFolder      = true,
         Name          = folder.Name,
         ParentId      = FindFolderItem(newParentFolder).ParentId,
         LastWriteTime = DateTime.Now
     });
 }
Ejemplo n.º 3
0
 public override void CreateFolder(FileManagerFolder parent, string name)
 {
     ProcessBlueprintDataProvider.Insert(new FileSystemItem
     {
         IsFolder      = true,
         Name          = name,
         ParentId      = FindFolderItem(parent).FileId,
         LastWriteTime = DateTime.Now
     });
     RefreshFolderCache();
 }
Ejemplo n.º 4
0
 public override void RenameFile(FileManagerFile file, string name)
 {
     ProcessBlueprintDataProvider.Update(new FileSystemItem
     {
         FileId        = FindFileItem(file).FileId,
         IsFolder      = false,
         Name          = name,
         LastWriteTime = DateTime.Now
     });
     RefreshFolderCache();
 }
Ejemplo n.º 5
0
 public override void RenameFolder(FileManagerFolder folder, string name)
 {
     ProcessBlueprintDataProvider.Update(new FileSystemItem
     {
         FileId        = FindFolderItem(folder).FileId,
         IsFolder      = true,
         Name          = name,
         ParentId      = FindFolderItem(folder).ParentId,
         LastWriteTime = DateTime.Now
     });
     RefreshFolderCache();
 }
Ejemplo n.º 6
0
 public override void UploadFile(FileManagerFolder folder, string fileName, Stream content)
 {
     ProcessBlueprintDataProvider.Insert(new FileSystemItem
     {
         IsFolder      = false,
         LastWriteTime = DateTime.Now,
         Name          = fileName,
         ParentId      = FindFolderItem(folder).FileId,
         Data          = ReadAllBytes(content)
     });
     //base.UploadFile(folder, fileName, content);
 }
Ejemplo n.º 7
0
        public override IEnumerable <FileManagerFile> GetFiles(FileManagerFolder folder)
        {
            if (string.IsNullOrEmpty(folder.Name.ToString()))
            {
                return(null);
            }
            FileSystemItem folderItem = FindFolderItem(folder);

            return(from item in ProcessBlueprintDataProvider.GetAll()
                   where !item.IsFolder && item.ParentId == folderItem.FileId
                   select new FileManagerFile(this, folder, item.Name));
        }
Ejemplo n.º 8
0
        public override void MoveFolder(FileManagerFolder folder, FileManagerFolder newParentFolder)
        {
            var folderData = FindFolderItem(folder);

            ProcessBlueprintDataProvider.Update(new FileSystemItem
            {
                FileId        = folderData.FileId,
                ParentId      = FindFolderItem(newParentFolder).ParentId,
                Name          = folderData.Name,
                LastWriteTime = DateTime.Now
            });
            RefreshFolderCache();
        }
Ejemplo n.º 9
0
        public override void MoveFile(FileManagerFile file, FileManagerFolder newParentFolder)
        {
            var fileData = FindFileItem(file);

            if (fileData != null)
            {
                ProcessBlueprintDataProvider.Update(new FileSystemItem
                {
                    FileId        = fileData.FileId,
                    ParentId      = FindFolderItem(newParentFolder).ParentId,
                    Name          = file.Name,
                    Data          = fileData.Data,
                    LastWriteTime = DateTime.Now
                });
            }
            RefreshFolderCache();
        }
Ejemplo n.º 10
0
 protected void RefreshFolderCache()
 {
     this.folderCache           = ProcessBlueprintDataProvider.GetAll().FindAll(x => x.IsFolder).ToDictionary(x => x.FileId);
     this.rootFolderDisplayName = (from folderItem in FolderCache.Values where folderItem.FileId == RootItemId select folderItem.Name).First();
 }
Ejemplo n.º 11
0
 public override void DeleteFile(FileManagerFile file)
 {
     ProcessBlueprintDataProvider.Delete(FindFileItem(file));
 }
Ejemplo n.º 12
0
 public override void DeleteFolder(FileManagerFolder folder)
 {
     ProcessBlueprintDataProvider.Delete(FindFolderItem(folder));
     RefreshFolderCache();
 }