##// END OF EJS Templates
minor refactoring
minor refactoring

File last commit:

r106:d4e38929ce36 v2
r116:da56ba7b1aab v2
Show More
SyncContextPromise.cs
22 lines | 687 B | text/x-csharp | CSharpLexer
/ Implab / SyncContextPromise.cs
using System.Threading;
namespace Implab {
public class SyncContextPromise<T> : Promise<T> {
readonly SynchronizationContext m_context;
public SyncContextPromise(SynchronizationContext context) {
Safe.ArgumentNotNull(context, "context");
m_context = context;
}
public SyncContextPromise(SynchronizationContext context, IPromise parent)
: base(parent) {
Safe.ArgumentNotNull(context, "context");
m_context = context;
}
protected override void InvokeHandler(AbstractHandler handler) {
m_context.Post(x => base.InvokeHandler(handler),null);
}
}
}