public static void SendToFront(Person p, object o) { foreach (var i in personsInFront) { if (p.id == i.id) { MessageBox.Show(p.surname + " " + p.name + " už je vo fronte. Nepodarilo sa pridať."); return; } } personsInFront.Add(p); MessageBox.Show(p.surname + " " + p.name + " bol pridaný do fronty."); if (btnFronta == null) { btnFronta = (o as Form).Controls[2].Controls[2] as Guna.UI.WinForms.GunaAdvenceButton; // fronta tlacidlo } btnFronta.Text = "Fronta (" + personsInFront.Count.ToString() + ")"; }
public Fronta(object obj) { InitializeComponent(); btnFronta = (obj as Form).Controls[2].Controls[2] as Guna.UI.WinForms.GunaAdvenceButton; // fronta tlacidlo lblInfo = (obj as Form).Controls[2].Controls[0] as Label; // info label }