private TemporaryDirectory ShareDataAndView(ZipFileShare zip, TemporaryDirectory tempDir) { tempDir = ShareSkydFile(zip, tempDir); string viewPath = SkylineWindow.GetViewFile(DocumentPath); if (File.Exists(viewPath)) { zip.AddFile(viewPath); } return(tempDir); }
private void ShareDataAndView(ZipFile zip) { string pathCache = ChromatogramCache.FinalPathForName(DocumentPath, null); if (File.Exists(pathCache)) { zip.AddFile(pathCache, string.Empty); } string viewPath = SkylineWindow.GetViewFile(DocumentPath); if (File.Exists(viewPath)) { zip.AddFile(viewPath, string.Empty); } }
/// <summary> /// Test tree state restoration from a persistent string. Tests for proper expansion and /// selection of nodes, and correct vertical scrolling /// </summary> protected override void DoTest() { // tests for a blank document RunUI(() => { SkylineWindow.NewDocument(); SetCurrentState(); SkylineWindow.SaveDocument(TestContext.GetTestPath("blank.sky")); // reload file from persistent string SkylineWindow.OpenFile(TestContext.GetTestPath("blank.sky")); CompareStates(); }); _documentFile = TestFilesDir.GetTestPath("Study7_0-7.sky"); // tests for a fully collapsed tree RunUI(() => { SkylineWindow.OpenFile(_documentFile); SkylineWindow.CollapseProteins(); CheckStateMaintained(); }); // tests for a fully expanded tree and scrolling RunUI(() => { SkylineWindow.OpenFile(_documentFile); SkylineWindow.ExpandPrecursors(); CheckStateMaintained(); SkylineWindow.SelectAll(); CheckStateMaintained(); // select last node in tree for scrolling test SelectNode(SkylineWindow.SequenceTree.Nodes[SkylineWindow.SequenceTree.Nodes.Count - 1], null); CheckStateMaintained(); }); // tests for expansion RunUI(() => { SkylineWindow.OpenFile(_documentFile); SkylineWindow.CollapseProteins(); SelectNode(SkylineWindow.SequenceTree.TopNode, null); CheckStateMaintained(); TestExpansion(); }); // tests for selection RunUI(() => { SkylineWindow.OpenFile(_documentFile); TestSingleSelect(); TestSelectLastNode(); TestRangeSelect(); TestDisjointSelect(); TestCombinedRangeDisjoint(); }); // tests that Skyline will not crash when there is a mismatch between stored data in the // .sky.view file and that in the tree RunUI(() => { SelectNode(SkylineWindow.SequenceTree.Nodes[1], null); SkylineWindow.SaveDocument(_documentFile); System.IO.File.Copy(SkylineWindow.GetViewFile(_documentFile), _documentFile + ".copy"); SkylineWindow.EditDelete(); CheckStateMaintained(); System.IO.File.Delete(SkylineWindow.GetViewFile(_documentFile)); System.IO.File.Copy(_documentFile + ".copy", SkylineWindow.GetViewFile(_documentFile)); SkylineWindow.OpenFile(_documentFile); }); }