public override void AddNew(IWin32Window owner) { Category category = CategoryEditor.CreateCategory(owner); if (category != null) { this.categories.Add(category); } }
private void tbbCategories_ItemClick(object sender, ItemClickEventArgs e) { var editor = new CategoryEditor(); using (var dlg = new DataListDialog(editor)) { if (dlg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { UpdateCategories(editor.List.Cast <Category>().ToList()); } } }
private void cboCategories_AddNewValue(object sender, AddNewValueEventArgs e) { var category = CategoryEditor.CreateCategory(this); if (category != null) { categories.Add(category); e.Cancel = false; e.NewValue = category.ID; } else { e.Cancel = true; } }