Beispiel #1
0
        public FilesystemStoryReader(IFilesystem filesystem, ConfigSettings settings)
        {
            _settings  = settings;
            Filesystem = filesystem;

            _filter = new FileExtensionFilter(_settings);
        }
        public FilesystemStoryReader(IFilesystem filesystem, ConfigSettings settings)
        {
            _settings = settings;
            Filesystem = filesystem;

            _filter = new FileExtensionFilter(_settings);
        }
        public IEnumerable<StoryInfo> GetStoryInfos()
        {
            var filter = new FileExtensionFilter(_settings);

            if (!filter.IsValid(_filename))
                return new StoryInfo[0];

            return new [] {new StoryInfo {Location = _filename, Text = _filesystem.GetFileText(_filename)}};
        }
Beispiel #4
0
        public IEnumerable <StoryInfo> GetStoryInfos()
        {
            var filter = new FileExtensionFilter(_settings);

            if (!filter.IsValid(_filename))
            {
                return(new StoryInfo[0]);
            }

            return(new [] { new StoryInfo {
                                Location = _filename, Text = _filesystem.GetFileText(_filename)
                            } });
        }
        private IEnumerable<StoryInfo> GetStoryInfos(string path)
        {
            if (Filesystem.FileExists(path))
            {
                return new[] {GetStoryInfo(path)};
            }
            var filter = new FileExtensionFilter(_settings);
            var stories = Filesystem
                .GetFilesInFolder(path)
                .Where(filter.IsValid)
                .Select(GetStoryInfo)
                .ToList();

            foreach (var subPath in Filesystem.GetSubFolders(path))
                stories.AddRange(GetStoryInfos(subPath));

            return stories;
        }