Пример #1
0
 public void RemoveBackgroundLoader(BackgroundLoader loader)
 {
     _backgroundLoaders.Remove(loader);
 }
Пример #2
0
 public LoadMonitor(BackgroundLoader manager, IDocumentContainer container, object tag)
 {
     _manager   = manager;
     _container = container;
     _tag       = tag;
 }
Пример #3
0
 public void AddBackgroundLoader(BackgroundLoader loader)
 {
     _backgroundLoaders.Add(loader);
 }
Пример #4
0
 public void Unregister(BackgroundLoader loader)
 {
     loader.ProgressUpdateEvent -= UpdateProgress;
 }
 public void Register(BackgroundLoader loader)
 {
     loader.ProgressUpdateEvent += UpdateProgress;
 }
Пример #6
0
 public LoadMonitor(BackgroundLoader manager, IDocumentContainer container, object tag)
 {
     _manager = manager;
     _container = container;
     _tag = tag;
 }
Пример #7
0
        private static SrmDocument CreateLibraryDocument(SrmSettings settings, string textFasta, bool peptideList,
            TestDocumentContainer docContainer, BackgroundLoader libraryManager, out int startRev)
        {
            startRev = 0;
            SrmDocument document = new SrmDocument(SrmSettingsList.GetDefault0_6());
            Assert.IsTrue(docContainer.SetDocument(document, null));

            // Register after first set document
            libraryManager.Register(docContainer);

            // Add libraries
            SrmDocument docLibraries = document.ChangeSettings(settings);
            ++startRev;

            // Add some FASTA
            IdentityPath path = IdentityPath.ROOT;
            SrmDocument docFasta = docLibraries.ImportFasta(new StringReader(textFasta), peptideList, path, out path);
            ++startRev;

            // Until libraries are loaded, only the sequences should appear
            if (!peptideList)
                AssertEx.IsDocumentState(docFasta, startRev, textFasta.Count(c => c == '>'), 0, 0);

            // Run the library load
            Assert.IsTrue(docContainer.SetDocument(docFasta, document, true));
            ++startRev;

            // After library load completes peptides and transitions should have expected library info
            SrmDocument docLoaded = docContainer.Document;

            // Check expected library inforamation
            foreach (var nodePeptide in docLoaded.Peptides)
                Assert.IsNull(nodePeptide.Rank);
            foreach (var nodeTran in docLoaded.PeptideTransitions)
            {
                Assert.IsTrue(nodeTran.HasLibInfo);
                Assert.IsTrue(nodeTran.LibInfo.Rank <= 3);
            }

            return docLoaded;
        }