Exemplo 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;
        }
Exemplo 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;
         }
     }
 }
Exemplo 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;
     }
 }
Exemplo n.º 4
0
 private async void ChangeActiveFile(BindableStorageFile arg)
 {
     string password = await GetPassword();
     if (password != null)
     {
         ActiveFile = arg;
         _codeDictionary = await GetCodes(password);
     }
 }
Exemplo 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();            
 }
Exemplo n.º 6
0
 public FileLocation GetFileLocation(BindableStorageFile file)
 {            
     return file.IsRoamed ? FileLocation.Roamed : FileLocation.Local;
 }
Exemplo n.º 7
0
 public FileService.FileLocation GetFileLocation(BindableStorageFile file)
 {
     throw new NotImplementedException();
 }