This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Task AsTask(this AsyncOperation asyncOperation, CancellationToken cancellationToken = default) | |
{ | |
cancellationToken.ThrowIfCancellationRequested(); | |
if (asyncOperation == null) | |
throw new ArgumentNullException(nameof(asyncOperation), "Provided async operation is null"); | |
if (asyncOperation.isDone) | |
return Task.CompletedTask; |