public void BeginInvoke(AsyncDelegate del) { ControllerMainAction mainAction = new SimpleDefaultMainAction(this, del); try { if (!View.IsHandleCreated) { return; } View.BeginInvoke(new AsyncDelegate(mainAction.run), null); } catch (ObjectDisposedException) { //happens because there is no synchronization between the lifecycle of a form and callbacks of background threads. //catch silently } }
public void Invoke(AsyncDelegate del, bool wait) { ControllerMainAction mainAction = new SimpleDefaultMainAction(this, del); invoke(mainAction, wait); }