private void AddButton_Click(object sender, EventArgs e) { var chooseTemplate = new TemplateOptionsForm(); var result = chooseTemplate.ShowDialog(this); if (result == DialogResult.OK) { ReloadData(); } }
private void EditButton_Click(object sender, EventArgs e) { var indices = TemplateListView.CheckedIndices; if (indices.Count != 1) { MessageBox.Show(this, "请勾选一个(只能选一个)模板条目。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } var index = indices[0]; var template = SortedTemplates[int.Parse(index.ToString())]; var editTemplate = new TemplateOptionsForm(template); var result = editTemplate.ShowDialog(this); if (result == DialogResult.OK) { ReloadData(); } }