public void Send(SendOrPostCallback d, object state) { if (_ctrl.InvokeRequired) { _ctrl.EndInvoke(_ctrl.BeginInvoke(d, state)); } else { _ctrl.Invoke(d, state); } }
public static Lambda0Inp <R> makeLambda0InpInvoke <R>(Lambda0Inp <R> l, System.Windows.Forms.Control c) { return(delegate() { if (c.InvokeRequired) { if (!c.IsDisposed) { //return (R)c.Invoke(l); IAsyncResult ar = c.BeginInvoke(l); return (R)c.EndInvoke(ar); } else { return default(R); } } else { return l(); } }); }