示例#1
0
        public List <RecordHeader> GetRecordHeaders(string searchText)
        {
            var files         = DataGateway.GetFileNames(GetEffectiveWorkingDirectory(), "*.rcd");
            var recordHeaders = files.Select(f => GetRecordFromUri(f).Header).ToList();

            return(Searcher.Search(recordHeaders, searchText));
        }
示例#2
0
        public void ReorganizeFiles(string recordId)
        {
            var validFiles  = new List <string>();
            var recordFiles = DataGateway.GetFileNames(GetEffectiveWorkingDirectory(), recordId + ".rcd");

            if (recordFiles.Count != 0)
            {
                var record = GetRecord(recordId);
                validFiles.AddRange(record.FileRecords.Select(x => x.AssociatedRecordId + "_" + x.FileId).ToList());
            }

            var pattern = recordId + "_*.encfile";
            var files   = DataGateway.GetFileNames(GetEffectiveWorkingDirectory(), pattern);

            foreach (var file in files)
            {
                var fileWithOutPath          = Path.GetFileName(file);
                var fileNameWithoutExtention = Path.GetFileNameWithoutExtension(fileWithOutPath);
                if (!validFiles.Contains(fileNameWithoutExtention))
                {
                    DataGateway.DeleteFileIfAvailable(file);
                }
            }
        }