c#如何知道使用线程运行的方法

时间:2015-03-24 00:27:44

标签: c# threadpool

我使用线程来显示等待屏幕。用户点击按钮进程,系统创建一个线程来显示等待屏幕并继续进程,我需要显示进程调用的方法。

public partial class Frm_Muestra_Consulta : Form
{
    private void Btn_Procesa_Click(object sender, EventArgs e)
    {
        Cls_Generales.Iniciar_Proceso(this);//calls the warning screen processing
        Cls_Consultas.Consultando(); //running process
        Cls_Generales.Terminar_Proceso(this); //Close the warning screen processing
    }
}

public class Cls_Generales
{
    public static void Inicia_Proceso(Form _Form)
    {
        Pantalla_Proceso = new Thread(new                
                        ThreadStart(Invoca_Pantalla_Proceso));
        Pantalla_Proceso.Start();
        _Form.Enabled = false;
    }
    public static void Invoca_Pantalla_Proceso()
    { Application.Run(new Frm_Procesando()); }

    public static void Termina_Proceso(Form _Form)
    { Pantalla_Proceso.Abort(); } 
}

public class Cls_Consultas
{
    public static DataTable Consultando()
    {
        //Methos to exemple
        //What I want is to tell the user when the system enters and 
        //leaves this method 
        Limpiar_Tabla();       
        Calcular_Espacio(); //and next
        return Realizar_Consulta(); //and next
    }

}

如何让纱线看到或阅读这些方法?

0 个答案:

没有答案