コード例 #1
0
ファイル: RefineMenu.cs プロジェクト: laeubisoft/pwiz
 public void ShowRenameProteinsDlg()
 {
     using (RenameProteinsDlg dlg = new RenameProteinsDlg(DocumentUI))
     {
         if (dlg.ShowDialog(SkylineWindow) == DialogResult.OK)
         {
             ModifyDocument(Resources.SkylineWindow_ShowRenameProteinsDlg_Rename_proteins,
                            doc => RenameProtein(doc, dlg), dlg.FormSettings.EntryCreator.Create);
         }
     }
 }
コード例 #2
0
ファイル: RefineMenu.cs プロジェクト: laeubisoft/pwiz
 private SrmDocument RenameProtein(SrmDocument doc, RenameProteinsDlg dlg)
 {
     foreach (var name in dlg.DictNameToName.Keys)
     {
         PeptideGroupDocNode node = Document.MoleculeGroups.FirstOrDefault(peptideGroup => Equals(name, peptideGroup.Name));
         if (node != null)
         {
             var renameProtein = new RenameProteinsDlg.RenameProteins {
                 CurrentName = name, NewName = dlg.DictNameToName[name]
             };
             if (renameProtein.CurrentName != renameProtein.NewName)
             {
                 doc = (SrmDocument)doc.ReplaceChild(node.ChangeName(renameProtein.NewName));
             }
         }
     }
     return(doc);
 }