Mercurial > pub > ImplabNet
view Implab/ActionTask.cs @ 155:037df317f126 v2
minor fixes for vs2012
author | cin |
---|---|
date | Fri, 12 Feb 2016 16:24:24 +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); } } } } }