/// <summary> /// Добавление данных в поля /// </summary> private void addbutton_Click(object sender, EventArgs e) { CreationForm formAdd = new CreationForm(); if (formAdd.ShowDialog() == DialogResult.OK) { if (formAdd.Figures == null) { return; } iFiguresBindingSource.Add(formAdd.Figures); } }
/// <summary> /// Изменение /// </summary> private void modifybutton_Click(object sender, EventArgs e) { if (iFiguresBindingSource.Current != null) { var creat = new CreationForm(); var index = iFiguresBindingSource.IndexOf(iFiguresBindingSource.Current); creat.Figures = (IFigures)iFiguresBindingSource.Current; iFiguresBindingSource.RemoveAt(index); creat.ShowDialog(); var figure = creat.Figures; iFiguresBindingSource.Insert(index, figure); _pointFixer = false; } else { MessageBox.Show(@"Не выбрана запись. Выберите запись и повторите попытку."); } }