更新时间:2022-04-18 07:10:35
IAsyncOperation
是一个地铁异步操作。您可以等待
的 IAsyncOperation
。
IAsyncOperation
is a metro asynchronous operation. You can await
an IAsyncOperation
.
不过,您不能使用 IAsyncOperation
与 Task.WhenAll
或任务。 WhenAny
。要使用 IAsyncOperation
情况下使用这些方法,你应该叫 StartAsTask
扩展方法,因为这样的:
However, you can't use IAsyncOperation
with Task.WhenAll
or Task.WhenAny
. To use IAsyncOperation
instances with these methods, you should call the StartAsTask
extension method, as such:
var folder = Windows.Storage.ApplicationData.Current.LocalFolder;
var fileTask = folder.GetFileAsync("text.txt").StartAsTask();