コード例 #1
0
        public string Format(IResourceMatch match)
        {
            if (!HasParameters)
            {
                return(_consolidatedUrlString);
            }

            var formattedString = _consolidatedUrlString;

            foreach (var placeholder in _placeholders)
            {
                var replacementValue = match.GetSubValue(placeholder);
                formattedString = formattedString.Replace("{" + placeholder + "}", replacementValue);
            }

            return(formattedString);
        }
コード例 #2
0
        public string Format(IResourceMatch match)
        {
            if (!HasParameters)
            {
                return(_consolidatedUrlString);
            }

            var formattedString = _consolidatedUrlString;

            foreach (Match rxMatch in _matches)
            {
                var name             = rxMatch.Groups["name"].Value;
                var replacementValue = match.GetSubValue(name);
                formattedString = formattedString.Replace("{" + name + "}", replacementValue);
            }

            return(formattedString);
        }
コード例 #3
0
 private string GetConsolidatedUrl(IResourceMatch match)
 {
     return(ConsolidatedUrlTemplate.Format(match));
 }
コード例 #4
0
 public InverseResourceMatch(IResourceMatch inner)
 {
     _inner = inner;
 }
コード例 #5
0
 public static IResourceMatch Inverse(this IResourceMatch match)
 {
     return(new InverseResourceMatch(match));
 }
コード例 #6
0
ファイル: IResourceMatch.cs プロジェクト: andyalm/assman
 public InverseResourceMatch(IResourceMatch inner)
 {
     _inner = inner;
 }
コード例 #7
0
 private string GetConsolidatedUrl(IResourceMatch match)
 {
     return ConsolidatedUrlTemplate.Format(match);
 }
コード例 #8
0
 public bool Matches(IResourceMatch resourceMatch)
 {
     return(_placeholders.All(resourceMatch.HasSubValue));
 }