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 #2
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)
                            } });
        }
Beispiel #3
0
        private IEnumerable <StoryInfo> GetStoryInfos(string path)
        {
            if (Filesystem.FileExists(path) && _filter.IsValid(path))
            {
                return new[] { GetStoryInfo(path) }
            }
            ;

            var filesMatchingFilter = GetFilesMatchingFilter(path);

            var stories = filesMatchingFilter
                          .Select(GetStoryInfo)
                          .ToList();

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

            return(stories);
        }