void RunInternal(PackageManagementProgressMonitor progressMonitor, ProgressMonitorStatusMessage progressMessage)
        {
            var commandLine = new MonoPclCommandLine()
            {
                List = true
            };

            commandLine.BuildCommandLine();

            progressMonitor.ShowPackageConsole();
            progressMonitor.Log.WriteLine(commandLine.ToString());
            progressMonitor.Log.WriteLine();

            RunMonoPcl(progressMonitor, progressMessage, commandLine);
        }
        public void Run()
        {
            ProgressMonitorStatusMessage     progressMessage = CreateProgressStatusMessage();
            PackageManagementProgressMonitor progressMonitor = CreateProgressMonitor(progressMessage);

            try {
                RunInternal(progressMonitor, progressMessage);
            } catch (Exception ex) {
                LoggingService.LogInternalError(ex);
                progressMonitor.Log.WriteLine(ex.Message);
                progressMonitor.ReportError(progressMessage.Error, null);
                progressMonitor.ShowPackageConsole();
                progressMonitor.Dispose();
            }
        }
 void RunMonoPcl(
     PackageManagementProgressMonitor progressMonitor,
     ProgressMonitorStatusMessage progressMessage,
     MonoPclCommandLine commandLine)
 {
     Runtime.ProcessService.StartConsoleProcess(
         commandLine.Command,
         commandLine.Arguments,
         commandLine.WorkingDirectory,
         progressMonitor.Console,
         null,
         (sender, e) => {
         using (progressMonitor) {
             ReportOutcome((ProcessAsyncOperation)sender, progressMonitor, progressMessage);
         }
     }
         );
 }