private async Task WaitForEnqueueAsync(ProjectConfigurationStateSynchronizer synchronizer, bool hasTask = true) { if (hasTask) { var kvp = Assert.Single(synchronizer.ProjectInfoMap); await LegacyDispatcher.RunOnDispatcherThreadAsync( () => kvp.Value.ProjectUpdateTask.Wait(), CancellationToken.None).ConfigureAwait(false); } else { Assert.Empty(synchronizer.ProjectInfoMap); } }
protected Task RunOnDispatcherThreadAsync(Func <Task> action) { return(LegacyDispatcher.RunOnDispatcherThreadAsync( async() => await action().ConfigureAwait(true), CancellationToken.None)); }
protected Task <TReturn> RunOnDispatcherThreadAsync <TReturn>(Func <TReturn> action) { return(LegacyDispatcher.RunOnDispatcherThreadAsync( () => action(), CancellationToken.None)); }