예제 #1
0
 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();
     }
 }
예제 #2
0
        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();
            }
        }