public bool AssembleFile() { IAssembleFileDialog dlg = null; try { dlg = dlgFactory.CreateAssembleFileDialog(); dlg.Services = sc; if (uiSvc.ShowModalDialog(dlg) != DialogResult.OK) { return(true); } mru.Use(dlg.FileName.Text); var typeName = dlg.SelectedArchitectureTypeName; var t = Type.GetType(typeName, true); var asm = (Assembler)t.GetConstructor(Type.EmptyTypes).Invoke(null); OpenBinary(dlg.FileName.Text, (f) => pageInitial.Assemble(f, asm)); } catch (Exception e) { uiSvc.ShowError(e, "An error occurred while assembling {0}.", dlg.FileName.Text); } return(true); }
public bool AssembleFile() { IAssembleFileDialog dlg = null; try { dlg = dlgFactory.CreateAssembleFileDialog(); dlg.Services = sc; if (uiSvc.ShowModalDialog(dlg) != DialogResult.OK) { return(true); } string fileName = dlg.FileName.Text; var arch = this.config.GetArchitecture(dlg.SelectedArchitectureName); var asm = arch.CreateAssembler(null); CloseProject(); SwitchInteractor(InitialPageInteractor); InitialPageInteractor.Assemble(fileName, asm, null); RememberFilenameInMru(fileName); if (fileName.EndsWith(Project_v5.FileExtension)) { ProjectFileName = fileName; } } catch (Exception e) { uiSvc.ShowError(e, "An error occurred while assembling {0}.", dlg.FileName.Text); } return(true); }
public bool AssembleFile() { IAssembleFileDialog dlg = null; try { dlg = dlgFactory.CreateAssembleFileDialog(); dlg.Services = sc; if (uiSvc.ShowModalDialog(dlg) != DialogResult.OK) { return(true); } var arch = this.config.GetArchitecture(dlg.SelectedArchitectureName); var asm = arch.CreateAssembler(null); OpenBinary(dlg.FileName.Text, (f) => pageInitial.Assemble(f, asm, null), f => false); RememberFilenameInMru(dlg.FileName.Text); } catch (Exception e) { uiSvc.ShowError(e, "An error occurred while assembling {0}.", dlg.FileName.Text); } return(true); }