示例#1
0
        private void TestNew_Click(object sender, EventArgs e)
        {
            var editForm = new EditTestForm();

            editForm.ShowDialog();
            if (editForm.DialogResult == DialogResult.OK)
            {
                guide.Tests.Add(new Test(editForm.test));
                TestBindingSource.ResetBindings(false);
                guide.changed = true;
            }
        }
示例#2
0
        private void TestEdit_Click(object sender, EventArgs e)
        {
            if (!(TestList.SelectedItem is Test item))
            {
                return;
            }
            int index    = guide.Tests.IndexOf(item);
            var editForm = new EditTestForm(item);

            editForm.ShowDialog();
            if (editForm.DialogResult == DialogResult.OK)
            {
                guide.Tests[index] = new Test(editForm.test);
                TestBindingSource.ResetBindings(false);
                guide.changed = true;
            }
        }