Exemplo n.º 1
0
 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));
     }
 }
Exemplo n.º 2
0
 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));
     }
 }