private void BtnSearch_Click(object sender, EventArgs e) { threadmethod += ReportBinding; using (WaitForm waitfrm = new WaitForm(() => { /*Thread.Sleep(2000);*/ dtpDate.Invoke(threadmethod); })) { waitfrm.ShowDialog(this); } }
public ThreadTask(threadAction mainAction) { myAction = () => { try { result = (T)(mainAction?.DynamicInvoke() ?? default(T)); threadFinishedSuccessfully = true; } catch (Exception ex) { threadException = ex; } }; }