public static IAsyncOperation ApplyStash(Stash s) { MessageDialogProgressMonitor monitor = new MessageDialogProgressMonitor(true, false, false, true); var statusTracker = IdeApp.Workspace.GetFileStatusTracker(); ThreadPool.QueueUserWorkItem(delegate { try { NGit.Api.MergeCommandResult result; using (var gm = new GitMonitor(monitor)) result = s.Apply(gm); ReportStashResult(monitor, result); } catch (Exception ex) { string msg = GettextCatalog.GetString("Stash operation failed."); monitor.ReportError(msg, ex); } finally { monitor.Dispose(); statusTracker.NotifyChanges(); } }); return(monitor.AsyncOperation); }
protected void OnButtonApplyClicked(object sender, System.EventArgs e) { Stash s = GetSelected(); if (s != null) { using (IdeApp.Workspace.GetFileStatusTracker()) s.Apply(); Respond(ResponseType.Ok); } }