当前位置: 首页>>代码示例>>C#>>正文


C# MessageDialogProgressMonitor.Dispose方法代码示例

本文整理汇总了C#中MonoDevelop.Ide.ProgressMonitoring.MessageDialogProgressMonitor.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# MessageDialogProgressMonitor.Dispose方法的具体用法?C# MessageDialogProgressMonitor.Dispose怎么用?C# MessageDialogProgressMonitor.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MonoDevelop.Ide.ProgressMonitoring.MessageDialogProgressMonitor的用法示例。


在下文中一共展示了MessageDialogProgressMonitor.Dispose方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SwitchToBranch

		public static void SwitchToBranch (GitRepository 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 ();
			}
		}
开发者ID:nickname100,项目名称:monodevelop,代码行数:21,代码来源:GitService.cs

示例2: Run

		protected override void Run ()
		{
			var dlg = new NewStashDialog ();
			try {
				if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok) {
					string comment = dlg.Comment;
					var monitor = new MessageDialogProgressMonitor (true, false, false, true);
					var statusTracker = IdeApp.Workspace.GetFileStatusTracker ();
					ThreadPool.QueueUserWorkItem (delegate {
						try {
							Stash stash;
							if (Repository.TryCreateStash (monitor, comment, out stash)) {
								string msg;
								if (stash != null) {
									msg = GettextCatalog.GetString ("Changes successfully stashed");
								} else {
									msg = GettextCatalog.GetString ("No changes were available to stash");
								}

								DispatchService.GuiDispatch (delegate {
									IdeApp.Workbench.StatusBar.ShowMessage (msg);
								});
							}

						} catch (Exception ex) {
							MessageService.ShowError (GettextCatalog.GetString ("Stash operation failed"), ex);
						}
						finally {
							monitor.Dispose ();
							statusTracker.Dispose ();
						}
					});
				}
			} finally {
				dlg.Destroy ();
				dlg.Dispose ();
			}
		}
开发者ID:riverans,项目名称:monodevelop,代码行数:38,代码来源:Commands.cs

示例3: Run

		protected override void Run ()
		{
			var stashes = Repository.GetStashes ();
			NewStashDialog dlg = new NewStashDialog ();
			if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok) {
				string comment = dlg.Comment;
				MessageDialogProgressMonitor monitor = new MessageDialogProgressMonitor (true, false, false, true);
				var statusTracker = IdeApp.Workspace.GetFileStatusTracker ();
				ThreadPool.QueueUserWorkItem (delegate {
					try {
						using (var gm = new GitMonitor (monitor))
							stashes.Create (gm, comment);
					} catch (Exception ex) {
						MessageService.ShowException (ex);
					}
					finally {
						monitor.Dispose ();
						statusTracker.NotifyChanges ();
					}
				});
			}
			dlg.Destroy ();
		}
开发者ID:jrhtcg,项目名称:monodevelop,代码行数:23,代码来源:Commands.cs

示例4: ApplyStash

		public static Task<bool> ApplyStash (GitRepository repo, int s)
		{
			var monitor = new MessageDialogProgressMonitor (true, false, false, true);
			var statusTracker = IdeApp.Workspace.GetFileStatusTracker ();
			var t = Task.Run (delegate {
				try {
					var res = repo.ApplyStash (monitor, s);
					ReportStashResult (res);
					return true;
				} catch (Exception ex) {
					string msg = GettextCatalog.GetString ("Stash operation failed.");
					monitor.ReportError (msg, ex);
					return false;
				}
				finally {
					monitor.Dispose ();
					statusTracker.Dispose ();
				}
			});
			return t;
		}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:21,代码来源:GitService.cs

示例5: SwitchToBranch

		public async static Task<bool> SwitchToBranch (GitRepository repo, string branch)
		{
			var monitor = new MessageDialogProgressMonitor (true, false, false, true);
			try {
				IdeApp.Workbench.AutoReloadDocuments = true;
				IdeApp.Workbench.LockGui ();
				var t = await Task.Run (delegate {
					try {
						return repo.SwitchToBranch (monitor, branch);
					} catch (Exception ex) {
						monitor.ReportError (GettextCatalog.GetString ("Branch switch failed"), ex);
						return false;
					} finally {
						monitor.Dispose ();
					}
				});
				return t;
			} finally {
				IdeApp.Workbench.AutoReloadDocuments = false;
				IdeApp.Workbench.UnlockGui ();
			}
		}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:22,代码来源:GitService.cs

示例6: ApplyStash

		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;
		}
开发者ID:raufbutt,项目名称:monodevelop-old,代码行数:21,代码来源:GitService.cs

示例7: SwitchToBranch

		public static void SwitchToBranch (GitRepository repo, string branch)
		{
			var monitor = new MessageDialogProgressMonitor (true, false, false, true);
			try {
				IdeApp.Workbench.AutoReloadDocuments = true;
				IdeApp.Workbench.LockGui ();
				Task.Run (delegate {
					try {
						repo.SwitchToBranch (monitor, branch);
					} catch (Exception ex) {
						monitor.ReportError ("Branch switch failed", ex);
					} finally {
						monitor.Dispose ();
					}
				}).Wait ();
			} finally {
				IdeApp.Workbench.AutoReloadDocuments = false;
				IdeApp.Workbench.UnlockGui ();
			}
		}
开发者ID:gAdrev,项目名称:monodevelop,代码行数:20,代码来源:GitService.cs

示例8: ApplyStash

		public static IAsyncOperation ApplyStash (GitRepository repo, int s)
		{
			var monitor = new MessageDialogProgressMonitor (true, false, false, true);
			var statusTracker = IdeApp.Workspace.GetFileStatusTracker ();
			ThreadPool.QueueUserWorkItem (delegate {
				try {
					ReportStashResult (repo.ApplyStash (monitor, s));
				} catch (Exception ex) {
					string msg = GettextCatalog.GetString ("Stash operation failed.");
					monitor.ReportError (msg, ex);
				}
				finally {
					monitor.Dispose ();
					statusTracker.Dispose ();
				}
			});
			return monitor.AsyncOperation;
		}
开发者ID:riverans,项目名称:monodevelop,代码行数:18,代码来源:GitService.cs


注:本文中的MonoDevelop.Ide.ProgressMonitoring.MessageDialogProgressMonitor.Dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。