コード例 #1
0
ファイル: Commands.cs プロジェクト: zhj149/monodevelop
        protected override void Run()
        {
            var monitor = new MessageDialogProgressMonitor(true, false, false, true);

            FileService.FreezeEvents();
            ThreadPool.QueueUserWorkItem(delegate {
                try {
                    int stashCount = Repository.GetStashes().Count();
                    StashApplyStatus stashApplyStatus = Repository.PopStash(monitor, 0);
                    GitService.ReportStashResult(Repository, stashApplyStatus, stashCount);
                } catch (Exception ex) {
                    MessageService.ShowError(GettextCatalog.GetString("Stash operation failed"), ex);
                }
                finally {
                    monitor.Dispose();
                    Runtime.RunInMainThread(delegate {
                        FileService.ThawEvents();
                    });
                }
            });
        }
コード例 #2
0
		public static void ReportStashResult (StashApplyStatus status)
		{
			if (status == StashApplyStatus.Conflicts) {
				string msg = GettextCatalog.GetString ("Stash applied with conflicts");
				Runtime.RunInMainThread (delegate {
					IdeApp.Workbench.StatusBar.ShowWarning (msg);
				});
			}
			else {
				string msg = GettextCatalog.GetString ("Stash successfully applied");
				Runtime.RunInMainThread (delegate {
					IdeApp.Workbench.StatusBar.ShowMessage (msg);
				});
			}
		}