private void newEncounterToolStripMenuItem_Click(object sender, EventArgs e) { if (!(check_if_db_open())) { return; } name_input n = new name_input(); n.ShowDialog(); if (n.name == "") { return; } ; if (current_driver.get_list_of_encounters().Contains(n.name)) { var yn = MessageBox.Show("Encounter " + n.name + " alredy exists replace?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (yn != DialogResult.Yes) { return; } } current_driver.new_encounter(n.name); encounterEdit eedit = new encounterEdit(current_driver, n.name); eedit.ShowDialog(); }
public select_list(sql_driver d) { InitializeComponent(); foreach (string name in d.get_list_of_encounters()) { listBox1.Items.Add(name); } }
private void update_list() { List <string> items = null; if (ty == "monster") { items = drive.get_list_of_monsters(); } if (ty == "encounter") { items = drive.get_list_of_encounters(); } listBox1.Items.Clear(); foreach (string i in items) { listBox1.Items.Add(i); } }