private void newPartWizardToolStripMenuItem_Click(object sender, EventArgs e) { using (var fm = new fmPartWizard(DevFile)) { if (fm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { var newPart = DevFile.PartsList[fm.SelectedPart]; newPart.PartName = fm.PartName; newPart.DeviceID = (uint)fm.DeviceId; newPart.ProgramMem = (uint)(fm.FlashSize / 2 + 1); //newPart.ConfigAddr = 0; DevFile.AddPart(newPart); // Reload GUI DeviceFileLoaded(); } } }