diff options
author | Lluis Sanchez <lluis@xamarin.com> | 2014-01-20 19:32:53 +0400 |
---|---|---|
committer | Lluis Sanchez Gual <lluis@xamarin.com> | 2014-10-21 18:39:14 +0400 |
commit | f73b2a9990495587d514aa1856919c21170a3940 (patch) | |
tree | 9842411ee8644ead5915a715ee7e53984a601df4 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs | |
parent | a2046b6331a271e8203df7d3d0f14500d33d60fa (diff) |
Initial drop of the new project model
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs index 0d39dfe617..52d41f001d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs @@ -28,6 +28,7 @@ using System; using Gtk; using System.Collections.Generic; using MonoDevelop.Core; +using System.Threading; namespace MonoDevelop.Ide.Gui.Dialogs { @@ -40,9 +41,8 @@ namespace MonoDevelop.Ide.Gui.Dialogs int ident = 0; List<TextTag> tags = new List<TextTag> (); Stack<string> indents = new Stack<string> (); - IAsyncOperation asyncOperation; - public event EventHandler OperationCancelled; - + CancellationTokenSource cancellationTokenSource; + public ProgressDialog (bool allowCancel, bool showDetails): this (null, allowCancel, showDetails) { } @@ -74,9 +74,9 @@ namespace MonoDevelop.Ide.Gui.Dialogs tags.Add (tag); } - public IAsyncOperation AsyncOperation { - get { return asyncOperation; } - set { asyncOperation = value; } + public CancellationTokenSource CancellationTokenSource { + get { return cancellationTokenSource; } + set { cancellationTokenSource = value; } } public string Message { @@ -168,11 +168,8 @@ namespace MonoDevelop.Ide.Gui.Dialogs protected void OnBtnCancelClicked (object sender, EventArgs e) { - if (asyncOperation != null) - asyncOperation.Cancel (); - - if (OperationCancelled != null) - OperationCancelled (this, null); + if (cancellationTokenSource != null) + cancellationTokenSource.Cancel (); } bool UpdateSize () |