Mercurial > pub > ImplabNet
view Implab/ActionTask.cs @ 169:54270c2f29f2 ref20160224
DFA refactoring
author | cin |
---|---|
date | Thu, 03 Mar 2016 08:41:02 +0300 |
parents | eb793fbbe4ea |
children | dd4a3590f9c6 |
line wrap: on
line source
using System; namespace Implab { public class ActionTask : ActionTaskBase, IDeferred { readonly Action m_task; public ActionTask(Action task, Action<Exception> error, Action<Exception> cancel, bool autoCancellable) : base(error,cancel, autoCancellable) { m_task = task; } public void Resolve() { if (m_task != null && LockCancelation()) { try { m_task(); SetResult(); } catch(Exception err) { HandleErrorInternal(err); } } } } }