private void doCallProgress(action action) { currentAction = action; action.Progress.ProgressChanged += new EventHandler(action_ProgressChanged); // Ejecuta una acción mostrando un progress... panProgress = new frmProgress(); panProgress.Start(); WaitCursor.Set(); // llama en otro thread a la llamada Thread t = new Thread(invokeAction); t.Name = "MedeaInvokerThread"; t.Start(); panProgress.ShowDialog(Form.ActiveForm); }
private void doCallProgress() { // Ejecuta una acción mostrando un progress... panProgress = new frmProgress(); panProgress.Start(); WaitCursor.Set(); // llama en otro thread a la llamada Thread t = new Thread(new ThreadStart(invoke)); t.Name = "MedeaInvokerThread"; t.Start(); if (panProgress.InvokeRequired) { MethodInvoker methodInvokerDelegate = delegate() { panProgress.ShowDialog(Form.ActiveForm); }; panProgress.Invoke(methodInvokerDelegate); } else { panProgress.ShowDialog(); } }