private void OptionsViewController_FormClosing(object sender, FormClosingEventArgs e) { //Lets Save the Profile data. FileStream writer = null; if (m_profileLocation != "") { if (m_createProfile) { writer = new FileStream(m_profileLocation, FileMode.Create, FileAccess.Write); try { BinaryFormatter binaryFormatter = new BinaryFormatter(); PlotOptions tmpPlotOptions = new PlotOptions(m_plotOptions); binaryFormatter.Serialize(writer, tmpPlotOptions); MainFormOptions tmpMainOptions = new MainFormOptions(m_mainFormOptions); binaryFormatter.Serialize(writer, tmpMainOptions); Options.FragmentLadderOptions tmpFragmentLadderOptions = new Options.FragmentLadderOptions(m_fragLadderOptions); binaryFormatter.Serialize(writer, tmpFragmentLadderOptions); } finally { writer.Close(); } } } }
protected override void OnClosing(CancelEventArgs e) { base.OnClosing(e); e.Cancel = true; FileStream writer = null; if (m_profileLocation != "") { if (m_createProfile) { writer = new FileStream(m_profileLocation, FileMode.Create, FileAccess.Write); try { BinaryFormatter binaryFormatter = new BinaryFormatter(); PlotOptions tmpPlotOptions = new PlotOptions(m_plotOptions); binaryFormatter.Serialize(writer, tmpPlotOptions); MainFormOptions tmpMainOptions = new MainFormOptions(m_mainFormOptions); binaryFormatter.Serialize(writer, tmpMainOptions); Options.FragmentLadderOptions tmpFragLadder = new Options.FragmentLadderOptions(m_fragLadderOptions); binaryFormatter.Serialize(writer, tmpFragLadder); } finally { writer.Close(); } } } this.Hide(); }
public FragmentLadderOptions(FragmentLadderOptions rhsOptions) { this.m_modificationList = rhsOptions.m_modificationList; this.m_checkedHeaders = rhsOptions.m_checkedHeaders; this.m_ammoniaLoss = rhsOptions.ammoniaLoss; this.m_waterLoss = rhsOptions.waterLoss; this.m_precision = rhsOptions.m_precision; }