Esempio n. 1
0
        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();
                    }
                }
            }
        }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
        /// <summary>
        /// The constructor for the form
        /// </summary>
        public SLPlot(Manager manager)
        {
            InitializeComponent();
            m_manager        = manager;
            msPlot.m_manager = manager;

            m_options = new PlotOptions();

            //Setup the parts of the form not involving zedgraph
            msPlot.m_updateCursorCallback   = UpdateSnapPoint;
            trackBarAnnotationPercent.Value = msPlot.m_options.annotationPercent;

            //set this true so that all keyboard events in any child control get processed by SLPlot first
            KeyPreview = true;
        }
Esempio n. 4
0
 public void CopyOptions(PlotOptions options)
 {
     showSnappingCursor = options.showSnappingCursor;
     showLegend         = options.showLegend;
     annotationPercent  = options.annotationPercent;
     annotationTextSize = options.annotationTextSize;
     annotationColor    = options.annotationColor;
     zoomHorizontal     = options.zoomHorizontal;
     hideUnmatched      = options.hideUnmatched;
     matchedColor       = options.matchedColor;
     unmatchedColor     = options.unmatchedColor;
     unzoomKey          = options.unzoomKey;
     focusOffset        = options.focusOffset;
     rightClickUnzoom   = options.rightClickUnzoom;
     hidePlotTools      = options.hidePlotTools;
     numberOfPlots      = options.numberOfPlots;
 }