I have the following doubt. As I do so that the parameter that I am passing to this function, adapts to the delegate that is assigned to DoWork + = ?? Since the parador is a string, I need the delegate to change based on that string.
public static bool EjecutaTarea(string NombreTareaEjecutar)
{
try
{
BackgroundWorker tarea = new BackgroundWorker();
tarea.DoWork += NombreTareaEjecutar;
tarea.RunWorkerCompleted += Terminado;
return true;
}
catch (Exception ex)
{
return false; }
}
static void Tarea1(object obj, DoWorkEventArgs args)
{
}
static void Tarea2(object obj, DoWorkEventArgs args)
{
}
static void Terminado(object obj, RunWorkerCompletedEventArgs args)
{
}
greetings