protected void EndAsync(IAsyncResult ar) { BaseControl.AsyncDelegate asyncDelegate = (BaseControl.AsyncDelegate)ar.AsyncState; try { asyncDelegate.EndInvoke(ar); } catch (Exception ex) { this.OnException(ex); } }
protected override void OnLoad(EventArgs e) { BaseControl.AsyncDelegate del = delegate { Thread.Sleep(1500); BaseControl.MethodInvoker uiDelegate = delegate { if (File.Exists(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Helper\\introduction.rtf"))) { this.rtxtIntroduction.LoadFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Helper\\introduction.rtf")); } this.rtxtIntroduction.Focus(); }; base.UpdateUI(uiDelegate, this); }; base.BeginInvoke(del); base.OnLoad(e); }
protected void BeginInvoke(BaseControl.AsyncDelegate del) { del.BeginInvoke(new AsyncCallback(this.EndAsync), del); }