コード例 #1
0
        private List <T> Filter <T>(
            FilterConfig config,
            IEnumerable <T> items,
            Func <FilterConfig, T, bool> func
            )
        {
            var result = new List <T>();

            foreach (var item in items)
            {
                if (func(config, item))
                {
                    continue;
                }

                result.Add(item);
            }

            return(result);
        }
コード例 #2
0
        private bool AppliesFile(FilterConfig config, FileInfo file)
        {
            var result = config.Entries.Any(x => AppliesFile(x, file));

            return(result);
        }
コード例 #3
0
 public List <DirectoryInfo> Filter(FilterConfig config, IEnumerable <DirectoryInfo> directories)
 => Filter(config, directories, AppliesDirectory);
コード例 #4
0
 public List <FileInfo> Filter(FilterConfig config, IEnumerable <FileInfo> files)
 => Filter(config, files, AppliesFile);
コード例 #5
0
 private bool AppliesDirectory(FilterConfig config, DirectoryInfo directory)
 => config.Entries.Any(x => AppliesDirectory(x, directory));