Esempio n. 1
0
        public static async Task<BindableStorageFile> Create(IStorageFile file)
        {
            BindableStorageFile bsf = new BindableStorageFile();
            bsf._backingFile = file;

            var props = await bsf._backingFile.GetBasicPropertiesAsync();            
            bsf._fileSize = GetHumanReadableSize(props.Size);
           
            return bsf;
        }
Esempio n. 2
0
 private async void RenameFile(BindableStorageFile item)
 {
     string newName = await GetNewName();
     if (newName != null)
     {
         await _fileService.RenameFileAsync(item, newName);                
         if(ActiveFile == item)
         {
             OpenFileText = item.Name;
         }
     }
 }
Esempio n. 3
0
 private async void DeleteFile(BindableStorageFile item)
 {
     FileService.FileLocation location = _fileService.GetFileLocation(item);
     await _fileService.DeleteFileAsync((StorageFile)item.BackingFile, location);
     FileGroups.First(x => x.Location == location)
         .Files
         .Remove(item);
     if (item == ActiveFile)
     {
         ActiveFile = null;
     }
 }
Esempio n. 4
0
 private async void ChangeActiveFile(BindableStorageFile arg)
 {
     string password = await GetPassword();
     if (password != null)
     {
         ActiveFile = arg;
         _codeDictionary = await GetCodes(password);
     }
 }
Esempio n. 5
0
 private async void RemoveFileFromSync(BindableStorageFile file)
 {
     FileGroups.First(x => x.Location == FileService.FileLocation.Roamed).Files.Remove(file);
     FileGroups.First(x => x.Location == FileService.FileLocation.Local).Files.Add(file);            
     await UpdateAvailableRoamingSpace();            
 }
Esempio n. 6
0
 public FileLocation GetFileLocation(BindableStorageFile file)
 {            
     return file.IsRoamed ? FileLocation.Roamed : FileLocation.Local;
 }
Esempio n. 7
0
 public FileService.FileLocation GetFileLocation(BindableStorageFile file)
 {
     throw new NotImplementedException();
 }