public override void Run() { // Initialized here since it's the thread itself that needs to call it //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final LOCAL threadLocalState = initialLocalState.get(); LOCAL threadLocalState = outerInstance.initialLocalState.get(); while (!outerInstance.shutDown && !ProcessorShutDown) { Task <LOCAL> task; try { task = outerInstance.queue.poll(10, MILLISECONDS); } catch (InterruptedException) { Thread.interrupted(); break; } if (task != null) { try { task(threadLocalState); } catch (Exception e) { outerInstance.ReceivePanic(e); outerInstance.Close(); throw new Exception(e); } } } }
public static List <Apreensao> SortTraffics(LOCAL local) { List <Apreensao> auxList = new List <Apreensao>(); foreach (Apreensao a in apreensoes) { if (a.Local == local) { auxList.Add(a); } } auxList.Sort(new MyComparer()); return(auxList); }
public static void MostraListaTraficantesOrigem(LOCAL origem) { int counter = 0; foreach (Traficante t in traficantes) { if (t.Origem == origem) { counter++; Traficante.MostraTraficante(t); } } if (counter == 0) { Console.WriteLine("Nenhum resultado encontrado"); } }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { string categoria = (string)TIPOLOCAL.SelectedItem; listBox1.Items.Clear(); if (categoria == "Tienda") { LOCAL.Items.Clear(); foreach (var item in Listas.tiendas) { LOCAL.Items.Add(item.Nombre); } } else if (categoria == "Cine") { LOCAL.ResetText(); LOCAL.Items.Clear(); foreach (var item in Listas.cines) { LOCAL.Items.Add(item.Nombre); } } else if (categoria == "Recreacional") { LOCAL.ResetText(); LOCAL.Items.Clear(); foreach (var item in Listas.recreacionales) { LOCAL.Items.Add(item.Nombre); } } else if (categoria == "Restoran") { LOCAL.ResetText(); LOCAL.Items.Clear(); foreach (var item in Listas.restoranes) { LOCAL.Items.Add(item.Nombre); } } }
public static void TopTen(LOCAL local) { List <Apreensao> auxList = new List <Apreensao>(); foreach (Apreensao aux in apreensoes) { if (aux.Local == local) { auxList.Add(aux); } } auxList.Sort(new MyComparer()); Console.WriteLine("TOP TEN Traficantes:\n"); for (int i = 0; i < 10; i++) { Console.WriteLine(i.ToString() + " - " + auxList[i].Traficante.Nome); } }
public static LOCAL CreateLOCAL(int cODIGO_LOCAL, string nOMBRE) { LOCAL lOCAL = new LOCAL(); lOCAL.CODIGO_LOCAL = cODIGO_LOCAL; lOCAL.NOMBRE = nOMBRE; return lOCAL; }
public void AddToLOCALES(LOCAL lOCAL) { base.AddObject("LOCALES", lOCAL); }