public static bool Execute(SimpleDelegate functionToExecute) { LongOpertationExecutor form = new LongOpertationExecutor(); form.FunctionToExecute = functionToExecute; form.Args = null; form.backgroundWorker.RunWorkerAsync(); return(form.ShowDialog() == DialogResult.OK); }
public static bool Execute(DelegateWithParams functionToExecute, params object[] args) { LongOpertationExecutor form = new LongOpertationExecutor(); form.FunctionToExecute = functionToExecute; form.Args = args; form.backgroundWorker.RunWorkerAsync(); return(form.ShowDialog() == DialogResult.OK); }