private void Command86() { if (Received.Count != 4) { return; } List <string> lista = Firebird.ReturnListMaquina(); List <string> temp = new List <string>(); for (int i = 1; i < 4; i++) { temp.Add(Received[i].ToString().PadLeft(2, '0')); } CurrentMachine = string.Format("{0}{1}-{2}", temp[0], temp[1], temp[2]); CurrentDescription = Firebird.ReturnCurrentDescription(CurrentMachine); lbMaquina.Text = CurrentDescription + $" ({CurrentMachine})"; EndCommand(); bool Exists = false; foreach (var item in lista) { if (item == CurrentMachine) { Exists = true; break; } } if (!Exists) { DialogResult result = MessageBox.Show("Nova máquina conectada, deseja salvá-la?", "Aviso", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { NovaMaquina form = new NovaMaquina(this); form.ShowDialog(); } } else { CurrentDescription = Firebird.ReturnCurrentDescription(CurrentMachine); } }