private void asmExeBrowseButton_Click(object sender, EventArgs e) { AsmComboItem item = (AsmComboItem)asmConfigComboBox.SelectedItem; AssemblerInfo.Id asmId = item.AssemblerId; // Figure out what we're looking for. For example, cc65 needs "cl65". AsmGen.IAssembler asm = AssemblerInfo.GetAssembler(asmId); asm.GetExeIdentifiers(out string humanName, out string exeName); // Ask the user to find it. string pathName = BrowseForExecutable(humanName, exeName); if (pathName != null) { asmExePathTextBox.Text = pathName; AssemblerConfig.SetConfig(mSettings, asmId, GetAsmConfigFromUi()); SetDirty(true); } }
/// <summary> /// Populates the UI elements from the asm config item in the settings. If that doesn't /// exist, use the default config. /// </summary> private void PopulateAsmConfigItems() { AsmComboItem item = (AsmComboItem)asmConfigComboBox.SelectedItem; AssemblerInfo.Id asmId = item.AssemblerId; AssemblerConfig config = AssemblerConfig.GetConfig(mSettings, asmId); if (config == null) { AsmGen.IAssembler asm = AssemblerInfo.GetAssembler(asmId); config = asm.GetDefaultConfig(); } asmExePathTextBox.Text = config.ExecutablePath; asmLabelColWidthTextBox.Text = config.ColumnWidths[0].ToString(); asmOpcodeColWidthTextBox.Text = config.ColumnWidths[1].ToString(); asmOperandColWidthTextBox.Text = config.ColumnWidths[2].ToString(); asmCommentColWidthTextBox.Text = config.ColumnWidths[3].ToString(); }