public BookPdf(Windows.Storage.IStorageFile file) { Task.Run(async() => { await LoadAsync(file ?? throw new ArgumentNullException(nameof(file))); }); }
public async Task Load(Windows.Storage.IStorageFile file) { Content = await pdf.PdfDocument.LoadFromFileAsync(file); OnLoaded(new EventArgs()); PageLoaded = true; ID = Functions.CombineStringAndDouble(file.Name, Content.PageCount); }
/// <summary> /// Initializes a new instance of the <see cref="StorageFile"/> class. /// </summary> /// <param name="parentFolder"> /// The parent folder. /// </param> /// <param name="file"> /// The associated <see cref="StorageFile"/>. /// </param> internal StorageFile(IStorageFolder parentFolder, Windows.Storage.IStorageFile file) { if (file == null) { throw new ArgumentNullException(nameof(file)); } this.file = file; this.Parent = parentFolder; }
/// <inheritdoc/> public async Task <bool> PickFile() { FileOpenPicker filePicker = new FileOpenPicker(); filePicker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.Desktop; filePicker.SettingsIdentifier = "oiwurei223i4u"; filePicker.FileTypeFilter.Add("*"); _pickedFile = await filePicker.PickSingleFileAsync(); return(_pickedFile != null); }
/// <summary> /// Copy file to destination /// </summary> /// <param name="Source"></param> /// <param name="Destination"></param> /// <returns></returns> public static async Task <IStorageFile> Copy(String Source, String Destination) { Windows.Storage.IStorageFile File = await GetFile(Source); if (File == null) { return(null); } Windows.Storage.IStorageFile CopiedFile = await File.CopyAsync(Windows.Storage.ApplicationData.Current.LocalFolder, Destination, NameCollisionOption.ReplaceExisting); return(CopiedFile); }
/// <summary> /// Store the content to the local storage of this device /// </summary> /// <param name="Content"></param> /// <param name="Filename"></param> public static async Task Delete(String Filename) { try { Windows.Storage.IStorageFile File = await GetFile(Filename); await File.DeleteAsync(); } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e.Message); } }
public UwpFile(Windows.Storage.IStorageFile file) { File = file; HasPath = File.Path != null; }
public FileUWP(Windows.Storage.IStorageFile content) { this.ContentUWP = content ?? throw new ArgumentNullException(nameof(content)); }