Exemple #1
0
 public IAsyncOperation <IRandomAccessStream> OpenAsync(FileAccessMode accessMode)
 => AsyncOperation <IRandomAccessStream> .FromTask(async (ct, _) => await _impl.Open(ct, accessMode, StorageOpenOptions.AllowReadersAndWriters));
Exemple #2
0
 public IAsyncOperation <IRandomAccessStream> OpenAsync(FileAccessMode accessMode, StorageOpenOptions options)
 => AsyncOperation <IRandomAccessStream> .FromTask(async (ct, _) => await _impl.Open(ct, accessMode, options));
Exemple #3
0
 public IAsyncOperation <string> InvokeScriptAsync(string scriptName, IEnumerable <string> arguments) =>
 AsyncOperation.FromTask(ct => InvokeScriptAsync(ct, scriptName, arguments?.ToArray()));
Exemple #4
0
 public IAsyncOperation <IReadOnlyList <StorageFile> > GetFilesAsync() => AsyncOperation.FromTask(ct => GetFilesTask(ct));
Exemple #5
0
 public static IAsyncOperation <StorageFile> GetFileFromPathAsync(string path)
 => AsyncOperation.FromTask(async ct => new StorageFile(new Local(path)));
Exemple #6
0
 public IAsyncOperation <StorageFolder> GetParentAsync()
 => AsyncOperation.FromTask(_impl.GetParent);
Exemple #7
0
 public static IAsyncOperation <bool> IsSupportedAsync() =>
 AsyncOperation.FromTask(token => IsSupportedTaskAsync(token));
Exemple #8
0
 public IAsyncOperation <StorageFile> CopyAsync(IStorageFolder destinationFolder)
 => AsyncOperation <StorageFile> .FromTask((ct, _) => _impl.Copy(ct, destinationFolder, global::System.IO.Path.GetFileName(Path), NameCollisionOption.FailIfExists));
Exemple #9
0
 /// <summary>
 /// Reads the contents of the specified file and returns lines of text.
 /// </summary>
 /// <param name="file">The file to read.</param>
 /// <returns>When this method completes successfully, it returns the contents of the file as a list
 /// (type <see cref="IList{string}" />) of lines of text. Each line of text in the list is represented
 /// by a <see cref="string"/> object.</returns>
 public static IAsyncOperation <IList <string> > ReadLinesAsync(IStorageFile file) =>
 AsyncOperation.FromTask(cancellationToken => ReadLinesTaskAsync(file, cancellationToken));
Exemple #10
0
 /// <summary>
 /// Reads the contents of the specified file using the specified character encoding and returns lines of text.
 /// </summary>
 /// <param name="file">The file to read.</param>
 /// <param name="encoding">The character encoding to use.</param>
 /// <returns>When this method completes successfully, it returns the contents of the file as a list
 /// (type <see cref="IList{string}" />) of lines of text. Each line of text in the list is represented
 /// by a <see cref="string"/> object.</returns>
 public static IAsyncOperation <IList <string> > ReadLinesAsync(IStorageFile file, UwpUnicodeEncoding encoding) =>
 AsyncOperation.FromTask(cancellationToken => ReadLinesTaskAsync(file, cancellationToken, encoding));
Exemple #11
0
 /// <summary>
 /// Reads the contents of the specified file and returns text.
 /// </summary>
 /// <param name="file">The file to read.</param>
 /// <returns>When this method completes successfully, it returns the contents
 /// of the file as a text string.</returns>
 public static IAsyncOperation <string> ReadTextAsync(IStorageFile file) =>
 AsyncOperation.FromTask(cancellationToken => ReadTextTaskAsync(file, cancellationToken));
Exemple #12
0
 /// <summary>
 /// Reads the contents of the specified file and returns a buffer.
 /// </summary>
 /// <param name="file">The file to read.</param>
 /// <returns>When this method completes, it returns an object
 /// (type <see cref="IBuffer" />) that represents the contents of the file.</returns>
 public static IAsyncOperation <IBuffer> ReadBufferAsync(IStorageFile file) =>
 AsyncOperation.FromTask(cancellationToken => ReadBufferTaskAsync(file, cancellationToken));
Exemple #13
0
 public IAsyncOperation <IReadOnlyList <StorageFolder> > GetFoldersAsync() => AsyncOperation.FromTask(ct => GetFoldersTask(ct));
Exemple #14
0
 public IAsyncOperation <StorageStreamTransaction> OpenTransactedWriteAsync()
 => AsyncOperation <StorageStreamTransaction> .FromTask((ct, _) => _impl.OpenTransactedWrite(ct, StorageOpenOptions.AllowReadersAndWriters));
Exemple #15
0
 public IAsyncOperation <Contact?> PickContactAsync() =>
 AsyncOperation.FromTask(token => PickContactTaskAsync(token));
Exemple #16
0
 public IAsyncOperation <StorageStreamTransaction> OpenTransactedWriteAsync(StorageOpenOptions options)
 => AsyncOperation <StorageStreamTransaction> .FromTask((ct, _) => _impl.OpenTransactedWrite(ct, options));
Exemple #17
0
 public IAsyncOperation <IList <Contact> > PickContactsAsync() =>
 AsyncOperation.FromTask(token => PickContactsTaskAsync(token));
Exemple #18
0
 public IAsyncOperation <StorageFile> CopyAsync(IStorageFolder destinationFolder, string desiredNewName, NameCollisionOption option)
 => AsyncOperation <StorageFile> .FromTask((ct, _) => _impl.Copy(ct, destinationFolder, desiredNewName, option));
Exemple #19
0
 public IAsyncOperation <bool> FlushAsync() => AsyncOperation.FromTask(async ct => { await _source.FlushAsync(); return(true); });
Exemple #20
0
 public static IAsyncOperation <StorageFile> GetFileFromApplicationUriAsync(Uri uri)
 => AsyncOperation.FromTask(ct => GetFileFromApplicationUri(ct, uri));
Exemple #21
0
 public IAsyncOperation <BasicProperties> GetBasicPropertiesAsync()
 => AsyncOperation.FromTask(_impl.GetBasicProperties);
Exemple #22
0
 public static IAsyncOperation <bool> FlushAsyncOperation(this Stream stream)
 => AsyncOperation.FromTask(async ct =>
 {
     await stream.FlushAsync(ct);
     return(true);
 });
Exemple #23
0
 public IAsyncOperation <IRandomAccessStreamWithContentType> OpenReadAsync()
 => AsyncOperation <IRandomAccessStreamWithContentType> .FromTask((ct, _) => _impl.Open(ct, FileAccessMode.Read, StorageOpenOptions.AllowReadersAndWriters));
Exemple #24
0
 public static IAsyncOperation <IBuffer> ReadBufferAsync(string absolutePath) =>
 AsyncOperation.FromTask(cancellationToken => ReadBufferTaskAsync(absolutePath, cancellationToken));
Exemple #25
0
 public IAsyncOperation <IReadOnlyList <IStorageItem> > GetItemsAsync() => AsyncOperation.FromTask(ct => GetItemsTask(ct));