Exemple #1
0
 private void boton_iniciar_Click(object sender, EventArgs e)
 {
     if (!iniciado)
     {
         if (hilo1 != null && hilo2 != null)
         {
             if (hilo1.dameNumeroDatos() == hilo2.dameNumeroDatos())
             {
                 lb_arch1.Items.Clear();
                 lb_arch2.Items.Clear();
                 lb_resultado.Items.Clear();
                 hilo1.comienza();
                 hilo2.comienza();
                 hiloR = new HiloOperacion(lb_resultado, lb_arch1, lb_arch2);
                 hiloR.comienza();
             }
             else
             {
                 MessageBox.Show("El tamaño de los archivos es distinto.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
         else
         {
             MessageBox.Show("No se han cargdo los dos archivos!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else if (pausado)
     {
         boton_iniciar.Text = "Iniciar";
         hilo1.continua();
         hilo2.continua();
         hiloR.continua();
     }
 }
Exemple #2
0
 private void boton_iniciar_Click(object sender, EventArgs e)
 {
     if (!iniciado)
     {
         if (hilo1 != null && hilo2 != null)
         {
             if (hilo1.dameNumeroDatos() == hilo2.dameNumeroDatos())
             {
                 lb_arch1.Items.Clear();
                 lb_arch2.Items.Clear();
                 lb_resultado.Items.Clear();
                 hilo1.comienza();
                 hilo2.comienza();
                 hiloR = new HiloOperacion(lb_resultado, lb_arch1, lb_arch2);
                 hiloR.comienza();
             }
             else
                 MessageBox.Show("El tamaño de los archivos es distinto.", "Error",MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else
             MessageBox.Show("No se han cargdo los dos archivos!", "Error",MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else if(pausado)
     {
         boton_iniciar.Text = "Iniciar";
         hilo1.continua();
         hilo2.continua();
         hiloR.continua();
     }
 }