public void ReDraw(bool async) { if (async) { DrawAsyncDelegate d = new DrawAsyncDelegate(Draw); d.BeginInvoke(null, null, null, null); } else { Draw(null, null); } }
//Асинхронная отрисовкай с задержкой на delay милисекунд public void ReDraw(int delay) { DrawAsyncDelegate d = new DrawAsyncDelegate(Draw); d.BeginInvoke(delay, new EventArgs(), null, null); }
// Manual sync/async drawing public void ReDraw(bool async) { if (async) { DrawAsyncDelegate d = new DrawAsyncDelegate(Draw); d.BeginInvoke(null, null, null, null); } else Draw(null, null); }