/// <summary> /// Обработчик события нажатия клавиши мыши на графический объект, /// который открывает диалоговое окно поиска типа оперативной памяти /// </summary> private void pictureBox3_Click(object sender, EventArgs e) { var editRamType = new EditRAMTypeForm(true); if (editRamType.ShowDialog() == DialogResult.OK) { if (editRamType.Edited) { BindRAMTypes(); } ramTypeBindingSource_CurrentChanged(ramTypeBindingSource, EventArgs.Empty); ramTypeBindingSource.Position = ramTypeBindingSource.IndexOf(editRamType.CurrentRamType); } }
/// <summary> /// Обработчик события нажатия клавиши мыши на графический объект, /// который открывает диалоговое окно поиска типа оперативной памяти /// </summary> private void pictureBox5_Click(object sender, EventArgs e) { var ramType = new EditRAMTypeForm(true); if (ramType.ShowDialog() == DialogResult.OK) { if (ramType.Edited) { BindRamTypes(); Edited = true; } ramTypeBindingSource_CurrentChanged(ramTypeBindingSource, EventArgs.Empty); ramTypeBindingSource.Position = ((BindingList <RamType>)ramTypeBindingSource.DataSource).IndexOf(ramType.CurrentRamType); } }
/// <summary> /// Обработчик события нажатия клавиши мыши на графический объект, /// который открывает диалоговое окно редактирования типов оперативной памяти /// </summary> private void pictureBox5_Click(object sender, EventArgs e) { var editRamType = new EditRAMTypeForm(); if (editRamType.ShowDialog() == DialogResult.OK) { var selectedRamType = ramTypeBindingSource.Current as RamType; BindRAMTypes(); if (selectedRamType != null) { int pos = ramTypeBindingSource.IndexOf(selectedRamType); if (pos > -1) { ramTypeBindingSource.Position = pos; } } } }