public void Select(Wip.ZoneArea area) { AreaList.SelectedItem = area; CurrentArea = area; DeleteButton.Enabled = area != null; RenameButton.Enabled = area != null; AreaChanged?.Invoke(this, null); }
private void AddArea_Click(object sender, EventArgs e) { StringDialog dlg = new StringDialog(); if (dlg.ShowDialog() == DialogResult.OK) { Wip.ZoneArea area = new Wip.ZoneArea { Name = dlg.String }; ZoneData.Areas.Add(area); Context.UnsavedChanges = true; AreaList.Items.Add(area); Select(area); } }