private void btnEdit_Click(object sender, EventArgs e) { Template tmp = (Template)lbTemplates.SelectedItem; FormTemplate form = new FormTemplate(tmp); if (form.ShowDialog() == DialogResult.OK) { gen.Templates[gen.Templates.IndexOf(tmp)] = form.Template; showCategories(form.Template.Category); save(); } }
private void btnNew_Click(object sender, EventArgs e) { Template tmp = new Template(); tmp.Name = "New Template"; tmp.Code = "Code..."; FormTemplate form = new FormTemplate(tmp); if (form.ShowDialog() == DialogResult.OK) { gen.Templates.Add(form.Template); showCategories(form.Template.Category); save(); } }