public IAsyncResult BeginRender(Delegate completed, Delegate status) { if (res == null) { res = new RenderResult(); interrupt.Reset(); Thread d = new Thread(new ParameterizedThreadStart(RenderFunction)); d.Start(new object[] { completed, status }); res.AsyncState = d; return(res); } else { throw new ApplicationException("BeginRender already called"); } }
public void EndRender(IAsyncResult Res) { interrupt.Set(); res = null; }