public SrmBrowserUI()
        {
            InitializeComponent();

            base.SetFileArgument("MRMFile", new OpenFileArgument("MRM Distiller", ".mrm"));

            PeptideItemUpdate += new ZedGraphMRMPeptideItemScans(zgcPeptide, this.CreateGraphics()).Update;

            ProductIonUpdate += new ZedGraphMRMProductIonScansAndRegression(zgcTransaction, this.CreateGraphics()).Update;
            ProductIonUpdate += (sender, e) =>
            {
                var ion          = e.Item;
                var lightEnabled = ion.Light == null ? null : (from scan in ion.Light.Intensities
                                                               where scan.Enabled
                                                               select scan).ToList();
                var heavyEnabled = ion.Heavy == null ? null : (from scan in ion.Heavy.Intensities
                                                               where scan.Enabled
                                                               select scan).ToList();
                lightView.DataSource = lightEnabled;
                heavyView.DataSource = heavyEnabled;
            };

            this.AddButton(btnSaveCross);
            this.AddButton(btnExport);

            this.Text = Constants.GetSQHTitle(title, version);
        }
        public SrmFileModeForm()
        {
            InitializeComponent();

            PeptideItemUpdate += UpdatePeptide;
            PeptideItemUpdate += new ZedGraphMRMPeptideItemScans(zgcPeptide, this.CreateGraphics()).Update;
            ProductIonUpdate  += new ZedGraphMRMProductIonScansAndRegression(zgcTransaction, this.CreateGraphics()).Update;

            ViewOption = new SrmViewOption();
        }
        public SrmValidatorUI()
        {
            InitializeComponent();

            this.Text = Constants.GetSQHTitle(title, version);

            this.viewOption = new SrmViewOption();

            FileModePeptideItemUpdate += new ZedGraphMRMPeptideItemScans(zgcFileModePeptide, this.CreateGraphics()).Update;
            FileModePeptideItemUpdate += new ZedGraphSrmPeptideItem(zgcAllInOne).Update;
            FileModeProductIonUpdate  += new ZedGraphMRMProductIonScansAndRegression(zgcFileModeTransaction, this.CreateGraphics()).Update;

            CompoundModePeptideItemUpdate += new ZedGraphMRMPeptideItemScans(zgcCompoundModePeptide, this.CreateGraphics()).Update;
            CompoundModePeptideItemUpdate += new ZedGraphMRMPeptideItemRetentionTimes(zgcRetentionTime).Update;

            btnFileMode.PerformClick();
        }
        public void Update(object sender, UpdateMRMPairedPeptideItemEventArgs e)
        {
            MasterPane myMaster = zgcGraph.MasterPane;

            myMaster.Border.IsVisible = false;
            myMaster.PaneList.Clear();

            bool updated = false;

            try
            {
                myMaster.Margin.All       = 1;
                myMaster.InnerPaneGap     = 1;
                myMaster.Title.IsVisible  = false;
                myMaster.Legend.IsVisible = false;

                var summary = e.Item;
                if (summary == null)
                {
                    return;
                }

                var ion = summary.ProductIonPairs.FirstOrDefault(m => m != null && m.FileName.Equals(FileName));
                if (ion == null)
                {
                    return;
                }

                ZedGraphMRMProductIonScansAndRegression scan = new ZedGraphMRMProductIonScansAndRegression(zgcGraph, g);
                scan.Update(null, new UpdateMRMPairedProductIonEventArgs(ion, e.ViewOption));
                updated = true;
            }
            finally
            {
                if (!updated)
                {
                    ZedGraphicExtension.UpdateGraph(this.zgcGraph);
                }
            }
        }