Exemple #1
0
 public InstallPackageResult OnInstallPackage(JToken arg)
 {
     try {
         var message = arg.ToObject <InstallPackageParams> ();
         var project = FindProject(message.ProjectFileName);
         var handler = new InstallPackageMessageHandler(project, message);
         handler.InstallPackageAsync(Token).WaitAndGetResult();
         return(new InstallPackageResult {
             IsPackageAlreadyInstalled = handler.IsPackageAlreadyInstalled
         });
     } catch (Exception ex) {
         LoggingService.LogError("OnInstallPackage error", ex);
         throw;
     }
 }
 public InstallPackageActionList OnPreviewInstallPackage(JToken arg)
 {
     try {
         var message = arg.ToObject <InstallPackageParams> ();
         var project = FindProject(message.ProjectFileName);
         var handler = new InstallPackageMessageHandler(project, message);
         var actions = handler.PreviewInstallPackageAsync(Token).WaitAndGetResult();
         return(new InstallPackageActionList {
             IsPackageAlreadyInstalled = handler.IsPackageAlreadyInstalled,
             Actions = CreatePackageActionInformation(actions).ToArray()
         });
     } catch (Exception ex) {
         LoggingService.LogError("OnPreviewInstallPackage error", ex);
         throw;
     }
 }