ControlBoundPromise.cs
23 lines
| 647 B
| text/x-csharp
|
CSharpLexer
/ Implab.Fx / ControlBoundPromise.cs
cin
|
r72 | using System.Windows.Forms; | ||
using System; | ||||
namespace Implab.Fx { | ||||
public class ControlBoundPromise<T> : Promise<T> { | ||||
readonly Control m_target; | ||||
public ControlBoundPromise(Control target) { | ||||
Safe.ArgumentNotNull(target, "target"); | ||||
m_target = target; | ||||
} | ||||
cin
|
r156 | protected override void SignalHandler(HandlerDescriptor handler, int signal) { | ||
cin
|
r119 | if (m_target.InvokeRequired) | ||
cin
|
r156 | m_target.BeginInvoke(new Action<Promise<T>.HandlerDescriptor, int>(base.SignalHandler), handler, signal); | ||
cin
|
r72 | else | ||
cin
|
r156 | base.SignalHandler(handler, signal); | ||
cin
|
r72 | } | ||
} | ||||
} | ||||