コード例 #1
0
        private static void SetupTestFolder(string folderToWatch, string instrument, out List <string> dataFiles, bool createRenamedData = false)
        {
            // Add subfolders
            var sf1   = CreateDirectory(folderToWatch, "One_QC");
            var sf1_1 = CreateDirectory(sf1, "QC_a");
            var sf2   = CreateDirectory(folderToWatch, "Two_QC_");

            var ext = AutoQCFileSystemWatcher.GetDataFileExt(instrument);

            var dataInDirs = AutoQCFileSystemWatcher.IsDataInDirectories(instrument);

            // Add files in the folders
            dataFiles = new List <string>
            {
                CreateDataFile(folderToWatch, "root_QC_" + ext, dataInDirs, createRenamedData),
                CreateDataFile(sf1, "QC_one" + ext, dataInDirs, createRenamedData),
                CreateDataFile(sf1_1, "one_1_a_QC_" + ext, dataInDirs, createRenamedData),
                CreateDataFile(sf1_1, "one_1_b_QC" + ext, dataInDirs, createRenamedData),
                CreateDataFile(sf2, "two_qc_" + ext, dataInDirs, createRenamedData)
            };

            // Add files that should not match
            if (!instrument.Equals(MainSettings.THERMO))
            {
                CreateInstrumentFile(sf1, MainSettings.THERMO);
            }
            if (!instrument.Equals(MainSettings.SCIEX))
            {
                CreateInstrumentFile(sf1, MainSettings.SCIEX);
            }
            if (!instrument.Equals(MainSettings.AGILENT) && !instrument.Equals(MainSettings.BRUKER))
            {
                CreateInstrumentFile(sf1, MainSettings.AGILENT);
            }
            if (!instrument.Equals(MainSettings.WATERS))
            {
                CreateInstrumentFile(sf1, MainSettings.WATERS);
            }
            if (!instrument.Equals(MainSettings.BRUKER) && !instrument.Equals(MainSettings.AGILENT))
            {
                CreateInstrumentFile(sf1, MainSettings.BRUKER);
            }
            if (!instrument.Equals(MainSettings.SHIMADZU))
            {
                CreateInstrumentFile(sf1, MainSettings.SHIMADZU);
            }
        }
コード例 #2
0
 private static void CreateInstrumentFile(string parentDir, string instrument)
 {
     CreateDataFile(parentDir, instrument + "_QC_" + AutoQCFileSystemWatcher.GetDataFileExt(instrument),
                    AutoQCFileSystemWatcher.IsDataInDirectories(instrument));
 }