private void ToolsCategory_Click(object sender, EventArgs e) { if (SelectedMap != null) { List <string> categories = new List <string>(); foreach (Map m in Session.Project.Maps) { if ((m.Category == null) || (m.Category == "")) { continue; } if (categories.Contains(m.Category)) { continue; } categories.Add(m.Category); } CategoryForm dlg = new CategoryForm(categories, SelectedMap.Category); if (dlg.ShowDialog() == DialogResult.OK) { SelectedMap.Category = dlg.Category; Session.Modified = true; update_maps(); } } }
private void ToolsCategory_Click(object sender, EventArgs e) { if (this.SelectedMap != null) { List <string> strs = new List <string>(); foreach (Map map in Session.Project.Maps) { if (map.Category == null || map.Category == "" || strs.Contains(map.Category)) { continue; } strs.Add(map.Category); } CategoryForm categoryForm = new CategoryForm(strs, this.SelectedMap.Category); if (categoryForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.SelectedMap.Category = categoryForm.Category; Session.Modified = true; this.update_maps(); } } }