Exemplo n.º 1
0
        static IAsyncOperation BuildPackages(ICollection packages)
        {
            IProgressMonitor mon = IdeApp.Workbench.ProgressMonitors.GetToolOutputProgressMonitor(true);

            // Run the deploy command in a background thread to avoid
            // deadlocks with the gui thread

            System.Threading.Thread t = new System.Threading.Thread(
                delegate()
            {
                using (mon)
                {
                    mon.BeginTask("Creating packages", packages.Count);
                    foreach (Package p in packages)
                    {
                        DeployService.BuildPackage(mon, p);
                        mon.Step(1);
                    }
                    mon.EndTask();
                }
            });
            t.IsBackground = true;
            t.Start();

            return(mon.AsyncOperation);
        }
Exemplo n.º 2
0
        static async Task BuildPackages(ICollection packages)
        {
            ProgressMonitor mon = IdeApp.Workbench.ProgressMonitors.GetToolOutputProgressMonitor(true);

            // Run the deploy command in a background thread to avoid
            // deadlocks with the gui thread

            using (mon) {
                mon.BeginTask("Creating packages", packages.Count);
                foreach (Package p in packages)
                {
                    await DeployService.BuildPackage(mon, p);

                    mon.Step(1);
                }
                mon.EndTask();
            }
        }