using System; namespace Implab { public class ActionTask : ActionTaskBase, IDeferred { readonly Action m_task; public ActionTask(Action task, Action error, Action cancel, bool autoCancellable) : base(error,cancel, autoCancellable) { m_task = task; } public void Resolve(T value) { if (m_task != null && LockCancelation()) { try { m_task(value); SetResult(); } catch(Exception err) { HandleErrorInternal(err); } } } } }