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(); } } }