Mercurial > pub > ImplabNet
comparison Implab.Fx/ControlBoundPromise.cs @ 145:706fccb85524 v2
RC: cancellation support for promises + tests
author | cin |
---|---|
date | Sun, 08 Mar 2015 02:52:27 +0300 |
parents | f75cfa58e3d4 |
children | 97fbbf816844 |
comparison
equal
deleted
inserted
replaced
144:8c0b95069066 | 145:706fccb85524 |
---|---|
10 Safe.ArgumentNotNull(target, "target"); | 10 Safe.ArgumentNotNull(target, "target"); |
11 | 11 |
12 m_target = target; | 12 m_target = target; |
13 } | 13 } |
14 | 14 |
15 protected override void SignalSuccess(IDeferred<T> handler) { | 15 protected override void SignalSuccess(Promise<T>.HandlerDescriptor handler) { |
16 if (m_target.InvokeRequired) | 16 if (m_target.InvokeRequired) |
17 m_target.BeginInvoke(new Action<IDeferred<T>>(base.SignalSuccess), handler); | 17 m_target.BeginInvoke(new Action<Promise<T>.HandlerDescriptor>(base.SignalSuccess), handler); |
18 else | 18 else |
19 base.SignalSuccess(handler); | 19 base.SignalSuccess(handler); |
20 } | 20 } |
21 | 21 |
22 protected override void SignalCancelled(IDeferred<T> handler, Exception reason) { | 22 protected override void SignalCancelled(Promise<T>.HandlerDescriptor handler, Exception reason) { |
23 if (m_target.InvokeRequired) | 23 if (m_target.InvokeRequired) |
24 m_target.BeginInvoke(new Action<IDeferred<T>,Exception>(base.SignalCancelled), handler, reason); | 24 m_target.BeginInvoke(new Action<Promise<T>.HandlerDescriptor,Exception>(base.SignalCancelled), handler, reason); |
25 else | 25 else |
26 base.SignalCancelled(handler, reason); | 26 base.SignalCancelled(handler, reason); |
27 } | 27 } |
28 | 28 |
29 protected override void SignalError(IDeferred<T> handler, Exception error) { | 29 protected override void SignalError(Promise<T>.HandlerDescriptor handler, Exception error) { |
30 if (m_target.InvokeRequired) | 30 if (m_target.InvokeRequired) |
31 m_target.BeginInvoke(new Action<IDeferred<T>,Exception>(base.SignalError), handler, error); | 31 m_target.BeginInvoke(new Action<Promise<T>.HandlerDescriptor,Exception>(base.SignalError), handler, error); |
32 else | 32 else |
33 base.SignalError(handler, error); | 33 base.SignalError(handler, error); |
34 } | 34 } |
35 | 35 |
36 } | 36 } |