##// END OF EJS Templates
minor fixes
minor fixes

File last commit:

r72:d67b95eddaf4 v2
r94:a43745f81f10 v2
Show More
ControlBoundPromise.cs
30 lines | 826 B | text/x-csharp | CSharpLexer
/ Implab.Fx / ControlBoundPromise.cs
cin
promises refactoring
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;
}
public ControlBoundPromise(Control target, IPromise parent, bool cancellable)
: base(parent, cancellable) {
Safe.ArgumentNotNull(target, "target");
m_target = target;
}
protected override void InvokeHandler(HandlerDescriptor handler) {
if (m_target.InvokeRequired)
m_target.BeginInvoke(new Action<HandlerDescriptor>(base.InvokeHandler), handler);
else
base.InvokeHandler(handler);
}
}
}