public void loadSBML(string sSBML) { if (InvokeRequired) { Invoke(new VoidStringDelegate(loadSBML), new object[] { sSBML }); } else { try { if (sSBML.Contains("jd:") && !sSBML.Contains("xmlns:jd = ")) { sSBML = sSBML.Replace("xmlns:jd2", "xmlns:jd = \"http://www.sys-bio.org/sbml\" xmlns:jd2"); } chkTakeAsIs.Checked = false; Simulator.model = null; Simulator.modelLoaded = false; Simulator.loadSBML(sSBML); CurrentModel = Simulator.model; _InitialState = new ModelState(CurrentModel); txtCode.Text = Simulator.getCSharpCode(); SelectForm.InitializeFromModel(CurrentModel); var oList = new ArrayList(new[] { "Time" }); oList.AddRange(Simulator.getFloatingSpeciesNames()); FormChangeTimeCoursePlot.Instance.XAxisValues = oList.ToArray(); if (CurrentModel != null) { setupControl1.Parameters = SelectForm.Parameters.ToArray(); } else { setupControl1.ParameterAvailable = false; } //_SelectForm.Show(); //_SelectForm.Focus(); SBML = sSBML; txtSBML.Text = SBML; txtJarnac.Text = Util.ConvertToJarnac(sSBML); SetTitle("SBML.xml"); } catch (SBWException ex) { MessageBox.Show(ex.Message + Environment.NewLine + Environment.NewLine + ex.DetailedMessage, "Loading the model failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void button1_Click(object sender, EventArgs e) { LoadFile("d:/Frank/SBML Models/BorisEjb.xml"); SelectForm.InitializeFromModel(CurrentModel); SelectForm.ShowDialog(); }