示例#1
0
        public static bool MatchOneOf(string pattern, Collection <String> inputs)
        {
            foreach (var input in inputs)
            {
                if (!WildcardSearch.Match(pattern, input))
                {
                    continue;
                }

                return(true);
            }

            return(false);
        }
示例#2
0
      public string[] GetChildPaths( string searchPattern, bool recursive )
      {
         var children = this.GetChildren();

         if ( children.Length == 0 )
         {
            var path = this.GetPath();
            return WildcardSearch.Match( searchPattern, path ) ? new string[] { path } : new string[0];
         }

         var paths = new List<string>();
         foreach ( var child in children )
         {
            if ( !child.IsContainer || recursive )
            {
               var childPaths = child.GetChildPaths( searchPattern, recursive );
               paths.AddRange( childPaths );
            }
         }

         return paths.ToArray();
      }