public newKombinace(Postava pos, Kombinace kombo) { InitializeComponent(); postava = pos; r1.Checked = true; r1.Enabled = false; r2.Enabled = false; TreeNode[] nodes = tree.Nodes.Find(kombo.zbran, true); if (nodes.Length != 0) { tree.SelectedNode = nodes[0]; } else { MessageBox.Show("V databázi neexistuje zbraň " + kombo.zbran); DialogResult = DialogResult.Abort; this.Close(); } list.SelectedIndex = list.FindString(kombo.stit); checkBox1.Checked = kombo.obouruc; if (Program.getDB().zbrane.FindByjmeno(kombo.zbran).obourucni == 1) { checkBox1.Checked = true; checkBox1.Enabled = false; } nazevKomba.Text = kombo.nazev; }
public void DeleteKomb(Kombinace kombo) { foreach (Kombinace k in kombinaceList) { if(k.Equals(kombo)) { kombinaceList.Remove(k); return; } } }
public void AddKomb(String nazev, String zbran, String stit, bool obouruc) { Kombinace kom = new Kombinace(this, flowPanel, nazev, zbran, stit, obouruc); kombinaceList.Add(kom); kom.Calculate(); }