diff Implab/Promise.cs @ 1:6fb3b01ee971

Added utility class for safe disposing methods. Added event fireing while promise is cancelled (needs some more work)
author cin
date Tue, 27 Aug 2013 08:28:42 +0400
parents 279591fb4df3
children aa367305156b
line wrap: on
line diff
--- a/Implab/Promise.cs	Fri Aug 23 04:38:46 2013 +0400
+++ b/Implab/Promise.cs	Tue Aug 27 08:28:42 2013 +0400
@@ -127,7 +127,12 @@
 		public bool Cancel() {
 			lock(this) {
 				if (m_state == State.Unresolved && m_cancellable) {
-					m_state = State.Cancelled;
+					m_state = State.Cancelled;
+                    EventHandler temp = Cancelled;
+                    
+                    if (temp != null)
+                        temp(this,new EventArgs());
+                    
 					return true;
 				} else
 					return false;