using System.Windows.Forms; using System; namespace Implab.Fx { public class ControlBoundPromise : Promise { readonly Control m_target; public ControlBoundPromise(Control target) { Safe.ArgumentNotNull(target, "target"); m_target = target; } protected override void SignalHandler(HandlerDescriptor handler, int signal) { if (m_target.InvokeRequired) m_target.BeginInvoke(new Action.HandlerDescriptor, int>(base.SignalHandler), handler, signal); else base.SignalHandler(handler, signal); } } }