Mercurial > pub > ImplabNet
comparison Implab.Fx/ControlBoundPromise.cs @ 156:97fbbf816844 v2
Promises: SignalXXX methods merged into SignalHandler method.
Components: RunnableComponent In progress
author | cin |
---|---|
date | Mon, 15 Feb 2016 04:22:15 +0300 |
parents | 706fccb85524 |
children |
comparison
equal
deleted
inserted
replaced
155:037df317f126 | 156:97fbbf816844 |
---|---|
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(Promise<T>.HandlerDescriptor handler) { | 15 protected override void SignalHandler(HandlerDescriptor handler, int signal) { |
16 if (m_target.InvokeRequired) | 16 if (m_target.InvokeRequired) |
17 m_target.BeginInvoke(new Action<Promise<T>.HandlerDescriptor>(base.SignalSuccess), handler); | 17 m_target.BeginInvoke(new Action<Promise<T>.HandlerDescriptor, int>(base.SignalHandler), handler, signal); |
18 else | 18 else |
19 base.SignalSuccess(handler); | 19 base.SignalHandler(handler, signal); |
20 } | 20 } |
21 | |
22 protected override void SignalCancelled(Promise<T>.HandlerDescriptor handler, Exception reason) { | |
23 if (m_target.InvokeRequired) | |
24 m_target.BeginInvoke(new Action<Promise<T>.HandlerDescriptor,Exception>(base.SignalCancelled), handler, reason); | |
25 else | |
26 base.SignalCancelled(handler, reason); | |
27 } | |
28 | |
29 protected override void SignalError(Promise<T>.HandlerDescriptor handler, Exception error) { | |
30 if (m_target.InvokeRequired) | |
31 m_target.BeginInvoke(new Action<Promise<T>.HandlerDescriptor,Exception>(base.SignalError), handler, error); | |
32 else | |
33 base.SignalError(handler, error); | |
34 } | |
35 | |
36 } | 21 } |
37 } | 22 } |
38 | 23 |