Mercurial > pub > ImplabNet
view Implab/ActionTask.cs @ 177:a0ff6a0e9c44 ref20160224
refactoring
author | cin |
---|---|
date | Wed, 23 Mar 2016 01:42:00 +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); } } } } }