public IAsyncOperation <IRandomAccessStream> OpenAsync(FileAccessMode accessMode) => AsyncOperation <IRandomAccessStream> .FromTask(async (ct, _) => await _impl.Open(ct, accessMode, StorageOpenOptions.AllowReadersAndWriters));
public IAsyncOperation <IRandomAccessStream> OpenAsync(FileAccessMode accessMode, StorageOpenOptions options) => AsyncOperation <IRandomAccessStream> .FromTask(async (ct, _) => await _impl.Open(ct, accessMode, options));
public IAsyncOperation <string> InvokeScriptAsync(string scriptName, IEnumerable <string> arguments) => AsyncOperation.FromTask(ct => InvokeScriptAsync(ct, scriptName, arguments?.ToArray()));
public IAsyncOperation <IReadOnlyList <StorageFile> > GetFilesAsync() => AsyncOperation.FromTask(ct => GetFilesTask(ct));
public static IAsyncOperation <StorageFile> GetFileFromPathAsync(string path) => AsyncOperation.FromTask(async ct => new StorageFile(new Local(path)));
public IAsyncOperation <StorageFolder> GetParentAsync() => AsyncOperation.FromTask(_impl.GetParent);
public static IAsyncOperation <bool> IsSupportedAsync() => AsyncOperation.FromTask(token => IsSupportedTaskAsync(token));
public IAsyncOperation <StorageFile> CopyAsync(IStorageFolder destinationFolder) => AsyncOperation <StorageFile> .FromTask((ct, _) => _impl.Copy(ct, destinationFolder, global::System.IO.Path.GetFileName(Path), NameCollisionOption.FailIfExists));
/// <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));
/// <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));
/// <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));
/// <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));
public IAsyncOperation <IReadOnlyList <StorageFolder> > GetFoldersAsync() => AsyncOperation.FromTask(ct => GetFoldersTask(ct));
public IAsyncOperation <StorageStreamTransaction> OpenTransactedWriteAsync() => AsyncOperation <StorageStreamTransaction> .FromTask((ct, _) => _impl.OpenTransactedWrite(ct, StorageOpenOptions.AllowReadersAndWriters));
public IAsyncOperation <Contact?> PickContactAsync() => AsyncOperation.FromTask(token => PickContactTaskAsync(token));
public IAsyncOperation <StorageStreamTransaction> OpenTransactedWriteAsync(StorageOpenOptions options) => AsyncOperation <StorageStreamTransaction> .FromTask((ct, _) => _impl.OpenTransactedWrite(ct, options));
public IAsyncOperation <IList <Contact> > PickContactsAsync() => AsyncOperation.FromTask(token => PickContactsTaskAsync(token));
public IAsyncOperation <StorageFile> CopyAsync(IStorageFolder destinationFolder, string desiredNewName, NameCollisionOption option) => AsyncOperation <StorageFile> .FromTask((ct, _) => _impl.Copy(ct, destinationFolder, desiredNewName, option));
public IAsyncOperation <bool> FlushAsync() => AsyncOperation.FromTask(async ct => { await _source.FlushAsync(); return(true); });
public static IAsyncOperation <StorageFile> GetFileFromApplicationUriAsync(Uri uri) => AsyncOperation.FromTask(ct => GetFileFromApplicationUri(ct, uri));
public IAsyncOperation <BasicProperties> GetBasicPropertiesAsync() => AsyncOperation.FromTask(_impl.GetBasicProperties);
public static IAsyncOperation <bool> FlushAsyncOperation(this Stream stream) => AsyncOperation.FromTask(async ct => { await stream.FlushAsync(ct); return(true); });
public IAsyncOperation <IRandomAccessStreamWithContentType> OpenReadAsync() => AsyncOperation <IRandomAccessStreamWithContentType> .FromTask((ct, _) => _impl.Open(ct, FileAccessMode.Read, StorageOpenOptions.AllowReadersAndWriters));
public static IAsyncOperation <IBuffer> ReadBufferAsync(string absolutePath) => AsyncOperation.FromTask(cancellationToken => ReadBufferTaskAsync(absolutePath, cancellationToken));
public IAsyncOperation <IReadOnlyList <IStorageItem> > GetItemsAsync() => AsyncOperation.FromTask(ct => GetItemsTask(ct));