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