Mercurial > pub > ImplabNet
comparison Implab.Fx/ControlBoundPromise.cs @ 192:f1da3afc3521 release v2.1
Слияние с v2
| author | cin |
|---|---|
| date | Fri, 22 Apr 2016 13:10:34 +0300 |
| parents | 97fbbf816844 |
| children |
comparison
equal
deleted
inserted
replaced
| 71:1714fd8678ef | 192:f1da3afc3521 |
|---|---|
| 1 using System.Windows.Forms; | |
| 2 using System; | |
| 3 | |
| 4 | |
| 5 namespace Implab.Fx { | |
| 6 public class ControlBoundPromise<T> : Promise<T> { | |
| 7 readonly Control m_target; | |
| 8 | |
| 9 public ControlBoundPromise(Control target) { | |
| 10 Safe.ArgumentNotNull(target, "target"); | |
| 11 | |
| 12 m_target = target; | |
| 13 } | |
| 14 | |
| 15 protected override void SignalHandler(HandlerDescriptor handler, int signal) { | |
| 16 if (m_target.InvokeRequired) | |
| 17 m_target.BeginInvoke(new Action<Promise<T>.HandlerDescriptor, int>(base.SignalHandler), handler, signal); | |
| 18 else | |
| 19 base.SignalHandler(handler, signal); | |
| 20 } | |
| 21 } | |
| 22 } | |
| 23 |
