コード例 #1
0
ファイル: PathFilterEx.cs プロジェクト: suh4s/BitShelter
        public static bool Apply(this PathFilter pathFilter, string path)
        {
            switch (pathFilter.FilterPatternType)
            {
            case FilterPatternType.Glob:
                return(pathFilter.GetSafeGlob().IsMatch(path));

            case FilterPatternType.Regexp:
                return(pathFilter.GetSafeRegexp().IsMatch(path));

            default:
                throw new ArgumentException(String.Format("FilterPatternType {0} not supported", (int)pathFilter.FilterPatternType), "pathFilter.FilterPatternType");
            }
        }