private async Task ExecuteActionAsync(IAction action) { using (new ProgressIndication(dispatcher, () => IsInstalling = true, () => IsInstalling = false)) { ActionProcessOutput.Clear(); await Task.Run(() => action.Execute(chocoExecutor, outputLineCallback => dispatcher.Invoke(() => ActionProcessOutput.Add(outputLineCallback)))); await chocoExecutor.UpdateAsync(packageRepo, nugetExecutor); } }
private async Task ExecuteUpgradeAllCommandAsync() { using (new ProgressIndication(dispatcher, () => IsUserAllowedToExecuteActions = false, () => IsUserAllowedToExecuteActions = true)) { ActionProcessOutput.Clear(); Filter = PackageDisplayTypeFactory.BuildUpgradeFilter(packageRepo, nugetExecutor, chocoExecutor); await ApplyFilterAsync(); var packagesToUpdate = Packages.ToArray(); // The list is copied, because the updated packages can be filtered away. chocoExecutor.Upgrade(packagesToUpdate, null, outputLineCallback => ActionProcessOutput.Add(outputLineCallback)); } await ExecuteRefreshCommandAsync(); }