예제 #1
0
        public static PeptideAnalysisFrame ShowPeptideAnalysis(PeptideAnalysis peptideAnalysis)
        {
            if (peptideAnalysis == null)
            {
                return(null);
            }
            var form = Program.FindOpenEntityForm <PeptideAnalysisFrame>(peptideAnalysis);

            if (form != null)
            {
                form.Activate();
                return(form);
            }
            using (peptideAnalysis.IncChromatogramRefCount())
            {
                TopographForm.Instance.LoadPeptideAnalysis(peptideAnalysis.Id);
                if (!peptideAnalysis.ChromatogramsWereLoaded)
                {
                    return(null);
                }
                form = new PeptideAnalysisFrame(peptideAnalysis);
                form.Show(TopographForm.Instance.DocumentPanel, DockState.Document);
                return(form);
            }
        }
예제 #2
0
            private void PeptideClickHandler(object sender, EventArgs eventArgs)
            {
                var peptide = _halfLifeResultRow.Peptide;

                if (peptide == null)
                {
                    return;
                }
                DbPeptideAnalysis dbPeptideAnalysis;

                using (var session = _form.Workspace.OpenSession())
                {
                    dbPeptideAnalysis = (DbPeptideAnalysis)session.CreateCriteria(typeof(DbPeptideAnalysis))
                                        .Add(Restrictions.Eq("Peptide", session.Load <DbPeptide>(peptide.Id)))
                                        .UniqueResult();
                    if (dbPeptideAnalysis == null)
                    {
                        return;
                    }
                    PeptideAnalysis peptideAnalysis;
                    if (!_form.Workspace.PeptideAnalyses.TryGetValue(dbPeptideAnalysis.Id.GetValueOrDefault(), out peptideAnalysis))
                    {
                        return;
                    }
                    var form = Program.FindOpenEntityForm <PeptideAnalysisFrame>(peptideAnalysis);
                    if (form != null)
                    {
                        form.Activate();
                        return;
                    }
                    using (peptideAnalysis.IncChromatogramRefCount())
                    {
                        TopographForm.Instance.LoadPeptideAnalysis(dbPeptideAnalysis.Id.GetValueOrDefault());
                        form = new PeptideAnalysisFrame(peptideAnalysis);
                        form.Show(_form.DockPanel, _form.DockState);
                    }
                }
            }
예제 #3
0
 private void PeptideClickHandler(object sender, EventArgs eventArgs)
 {
     var peptide = _halfLifeResultRow.Peptide;
     if (peptide == null)
     {
         return;
     }
     DbPeptideAnalysis dbPeptideAnalysis;
     using (var session = _form.Workspace.OpenSession())
     {
         dbPeptideAnalysis = (DbPeptideAnalysis) session.CreateCriteria(typeof (DbPeptideAnalysis))
             .Add(Restrictions.Eq("Peptide", session.Load<DbPeptide>(peptide.Id)))
             .UniqueResult();
         if (dbPeptideAnalysis == null)
         {
             return;
         }
         PeptideAnalysis peptideAnalysis;
         if (!_form.Workspace.PeptideAnalyses.TryGetValue(dbPeptideAnalysis.Id.GetValueOrDefault(), out peptideAnalysis))
         {
             return;
         }
         var form = Program.FindOpenEntityForm<PeptideAnalysisFrame>(peptideAnalysis);
         if (form != null)
         {
             form.Activate();
             return;
         }
         using (peptideAnalysis.IncChromatogramRefCount())
         {
             TopographForm.Instance.LoadPeptideAnalysis(dbPeptideAnalysis.Id.GetValueOrDefault());
             form = new PeptideAnalysisFrame(peptideAnalysis);
             form.Show(_form.DockPanel, _form.DockState);
         }
     }
 }
예제 #4
0
 public static PeptideAnalysisFrame ShowPeptideAnalysis(PeptideAnalysis peptideAnalysis)
 {
     if (peptideAnalysis == null)
     {
         return null;
     }
     var form = Program.FindOpenEntityForm<PeptideAnalysisFrame>(peptideAnalysis);
     if (form != null)
     {
         form.Activate();
         return form;
     }
     using (peptideAnalysis.IncChromatogramRefCount())
     {
         TopographForm.Instance.LoadPeptideAnalysis(peptideAnalysis.Id);
         if (!peptideAnalysis.ChromatogramsWereLoaded)
         {
             return null;
         }
         form = new PeptideAnalysisFrame(peptideAnalysis);
         form.Show(TopographForm.Instance.DocumentPanel, DockState.Document);
         return form;
     }
 }