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; }
private async void RenameFile(BindableStorageFile item) { string newName = await GetNewName(); if (newName != null) { await _fileService.RenameFileAsync(item, newName); if(ActiveFile == item) { OpenFileText = item.Name; } } }
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; } }
private async void ChangeActiveFile(BindableStorageFile arg) { string password = await GetPassword(); if (password != null) { ActiveFile = arg; _codeDictionary = await GetCodes(password); } }
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(); }
public FileLocation GetFileLocation(BindableStorageFile file) { return file.IsRoamed ? FileLocation.Roamed : FileLocation.Local; }
public FileService.FileLocation GetFileLocation(BindableStorageFile file) { throw new NotImplementedException(); }