public static void SwitchToBranch(MercurialRepository repo, string branch) { MessageDialogProgressMonitor monitor = new MessageDialogProgressMonitor(true, false, false, true); try { IdeApp.Workbench.AutoReloadDocuments = true; IdeApp.Workbench.LockGui(); System.Threading.ThreadPool.QueueUserWorkItem(delegate { try { repo.SwitchToBranch(monitor, branch); } catch (Exception ex) { monitor.ReportError("Branch switch failed", ex); } finally { monitor.Dispose(); } }); monitor.AsyncOperation.WaitForCompleted(); } finally { IdeApp.Workbench.AutoReloadDocuments = false; IdeApp.Workbench.UnlockGui(); } }
public static void SwitchToBranch(MercurialRepository repo, string branch) { MessageDialogProgressMonitor monitor = new MessageDialogProgressMonitor (true, false, false, true); try { IdeApp.Workbench.AutoReloadDocuments = true; IdeApp.Workbench.LockGui (); System.Threading.ThreadPool.QueueUserWorkItem (delegate { try { repo.SwitchToBranch (monitor, branch); } catch (Exception ex) { monitor.ReportError ("Branch switch failed", ex); } finally { monitor.Dispose (); } }); monitor.AsyncOperation.WaitForCompleted (); } finally { IdeApp.Workbench.AutoReloadDocuments = false; IdeApp.Workbench.UnlockGui (); } }