Exemplo n.º 1
0
        public List <MetadataItem> GetAllMetadataItems(DirectoryTestable directoryTestable)
        {
            _targetPath = directoryTestable.GetRepositoryDir();
            var       folderPaths            = this.GetAllFolderPaths(directoryTestable, this._targetPath);
            ArrayList xmlPathsFromAllFolders = new ArrayList();
            ArrayList metadataItemList       = new ArrayList();

            foreach (string folderPath in folderPaths)
            {
                var xmlPathsFromOneFolder = this.GetAllXmlPaths(_directoryTestable, folderPath);
                xmlPathsFromAllFolders.AddRange(xmlPathsFromOneFolder);
            }

            foreach (var xmlPath in xmlPathsFromAllFolders)
            {
                metadataItemList.Add(this._fileService.DeserializeMetadataItem(_fileService.serializeTestable, (String)xmlPath));
            }

            this.MetadataItems = metadataItemList.Cast <MetadataItem>().ToList();
            return(this.MetadataItems);
        }
Exemplo n.º 2
0
        public ArrayList GetAllXmlPaths(DirectoryTestable directoryTestable, String folderPath)
        {
            var result = directoryTestable.GetAllXmlPaths(folderPath);

            return(result);
        }
Exemplo n.º 3
0
        public String[] GetAllFolderPaths(DirectoryTestable directoryTestable, String targetPath)
        {
            var result = directoryTestable.GetAllFolderPaths(targetPath);

            return(result);
        }
Exemplo n.º 4
0
 public SearchService()
 {
     _fileService       = new FileService();
     _directoryTestable = new DirectoryTestable();
     _filteredItems     = new List <MetadataItem>();
 }
Exemplo n.º 5
0
 public String GetRepositoryDir(DirectoryTestable directoryTestable)
 {
     return(directoryTestable.GetRepositoryDir());
 }