private async Task UpgradePackage_ExecutedAsync(object sender, ExecutedRoutedEventArgs e) { try { var view = (PipPackageView)e.Parameter; // Construct a PackageSpec with the upgraded version. await _provider.InstallPackage(new PackageSpec(view.Package.Name, view.UpgradeVersion)); } catch (OperationCanceledException) { } catch (Exception ex) when(!ex.IsCriticalException()) { ToolWindow.SendUnhandledException(this, ExceptionDispatchInfo.Capture(ex)); } }
private async void UpgradePackage_Executed(object sender, ExecutedRoutedEventArgs e) { try { var view = (PipPackageView)e.Parameter; // Provide Name, not PackageSpec, or we'll upgrade to our // current version. await _provider.InstallPackage(new PackageSpec(view.Name)); } catch (OperationCanceledException) { } catch (Exception ex) when(!ex.IsCriticalException()) { ToolWindow.SendUnhandledException(this, ExceptionDispatchInfo.Capture(ex)); } }