Example #1
0
        private void ProximaPatente(VistaPatente vp)
        {
            Thread hilo = new Thread(vp.MostrarPatente);

            hilo.Start(cola.Dequeue());
            this.hilos.Add(hilo);
        }
Example #2
0
 public void ProximaPatente(VistaPatente vp)
 {
     if (cola.Count > 0)
     {
         Thread t = new Thread(new ParameterizedThreadStart(vp.MostrarPatente));
         t.Start(cola.Dequeue());
         hilos.Add(t);
     }
 }
 public void ProximaPatente(VistaPatente vp)
 {
     while (cola.Count > 0)
     {
         Thread hilo = new Thread(vp.MostrarPatente);
         hilo.Start(cola.Dequeue());
         this.hilos.Add(hilo);
     }
 }
Example #4
0
 void ProximaPatente(VistaPatente vp)
 {
     if (this.cola.Count > 0)
     {
         Thread thread = new Thread(new ParameterizedThreadStart(vp.MostrarPatente));
         thread.Start(this.cola.Dequeue());
         this.threads.Add(thread);
     }
 }
Example #5
0
 private void ProximaPatente(VistaPatente vp)
 {
     if (cola.Count > 0)
     {
         Thread hilo = new Thread(new ParameterizedThreadStart(vp.MostrarPatente));
         hilo.Start(cola.Dequeue());
         this.hilos.Add(hilo);
     }
 }
 private void ProximaPatente(VistaPatente patente)
 {
     while (this.cola.Count > 0)
     {
         Thread nuevoHilo = new Thread(patente.MostrarPatente);
         hilos.Add(nuevoHilo);
         nuevoHilo.Start(patente);
     }
 }
Example #7
0
 private void ProximaPatente(VistaPatente vp)
 {
     if (this.cola.Count > 0)
     {
         Thread thread = new Thread(vp.MostrarPatente);
         thread.Start(cola.Dequeue());
         this.threads.Add(thread);
     }
 }
Example #8
0
 public void ProximaPatente(VistaPatente vp)
 {
     while (this.cola.Count > 0)
     {
         Thread t = new Thread(vp.MostrarPatente);
         t.Start(this.cola.Dequeue());
         this.threads.Add(t);
         //vp.MostrarPatente(this.cola.Dequeue());
     }
 }
Example #9
0
        private void ProximaPatente(VistaPatente vistaPatente)
        {
            if (cola.Count != 0 && cola != null)
            {
                Thread t = new Thread(new ParameterizedThreadStart(vistaPatente.MostrarPatente));

                t.Start(cola.Last());

                threads.Add(t);
            }
        }
Example #10
0
 private void ProximaPatente(VistaPatente vp)
 {
     if (this.hilos.Count > 0)
     {
         Thread hilo = new Thread(vp.MostrarPatente);
         //Inicializará el hilo recién creado con el próximo elemento de la cola.
         hilo.Start(cola.Dequeue());
         //Agregará el hilo a la lista.
         this.hilos.Add(hilo);
     }
 }
Example #11
0
 public void ProximaPatente(VistaPatente vistaPatente)
 {
     /* ProximaPatente, si hay elementos en la cola de patentes:
      * a. Instanciará un hilo parametrizado para el método MostrarPatente del objeto VistaPatente recibido.
      * b. Inicializará el hilo recién creado con el próximo elemento de la cola.
      * c. Agregará el hilo a la lista.*/
     if (this.cola.Count > 0)
     {
         Thread hilo = new Thread(new ParameterizedThreadStart(vistaPatente.MostrarPatente));
         hilo.Start(this.cola.Dequeue());
         this.listaThreads.Add(hilo);
     }
 }
Example #12
0
 private void btnSql_Click(object sender, EventArgs e)
 {
     try
     {
         Queue <Patente> patentes = new Queue <Patente>();
         Archivos.Sql    sql      = new Archivos.Sql();
         sql.Leer("Patentes", out patentes);
         foreach (Patente p in patentes)
         {
             VistaPatente.Invoke(p);
             cola.Enqueue(p.ValidarPatente(p.CodigoPatente));
         }
     }
     catch (Exception ex)
     {
     }
     IniciarSimulacion();
 }
Example #13
0
 private void btnXml_Click(object sender, EventArgs e)
 {
     Patente[] patentes           = new Patente[10];
     Archivos.Xml <Patente[]> xml = new Xml <Patente[]>();
     try
     {
         xml.Leer("patentes.xml", out patentes);
     }
     catch (Exception exception)
     {
     }
     foreach (Patente p in patentes)
     {
         VistaPatente.Invoke(p);
         cola.Enqueue(p.ValidarPatente(p.CodigoPatente));
     }
     IniciarSimulacion();
 }
Example #14
0
        private void btnTxt_Click(object sender, EventArgs e)
        {
            Archivos.Texto texto = new Archivos.Texto();
            string         datos;

            texto.Leer("patentes.txt", out datos);

            string[] patentes = datos.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
            foreach (string patente in patentes)
            {
                try
                {
                    Patente p = new Patente();
                    p = p.ValidarPatente(patente);
                    VistaPatente.Invoke(p);
                    cola.Enqueue(p.ValidarPatente(p.CodigoPatente));
                }
                catch (Exception ex)
                {
                }
                IniciarSimulacion();
            }
        }
 private void ProximaPatente(VistaPatente vp)
 {
 }