示例#1
0
 private bool IsFileExtension(PathMatcher pathMatcher, out string ext) {
   ext = "";
   var result =
     pathMatcher.Operators.Count == 3 &&
     pathMatcher.Operators[0] is OpIsRelativeDirectory &&
     pathMatcher.Operators[1] is OpAsterisk &&
     pathMatcher.Operators[2] is OpText &&
     IsFileExtensionString(((OpText)pathMatcher.Operators[2]).Text);
   if (result)
     ext = ((OpText)pathMatcher.Operators[2]).Text;
   return result;
 }
示例#2
0
        private bool IsFileExtension(PathMatcher pathMatcher, out string ext)
        {
            ext = "";
            var result =
                pathMatcher.Operators.Count == 3 &&
                pathMatcher.Operators[0] is OpIsRelativeDirectory &&
                pathMatcher.Operators[1] is OpAsterisk &&
                pathMatcher.Operators[2] is OpText &&
                IsFileExtensionString(((OpText)pathMatcher.Operators[2]).Text);

            if (result)
            {
                ext = ((OpText)pathMatcher.Operators[2]).Text;
            }
            return(result);
        }