Example #1
0
        public IFormattingFluentSyntax SetFileNameReplacer(string key, string replacement)
        {
            FileNameReplacer found = this.options.FileNameReplacer.FirstOrDefault(x => x.Key == key);

            if (found == null)
            {
                throw new InvalidOperationException($"FileNameReplace {key} does not exists. Use {nameof(this.AddFileNameReplacer)} first");
            }
            found.SetReplacement(replacement);
            return(this);
        }
Example #2
0
        public IFormattingFluentSyntax AddOrSetFileNameReplacer(string key, string pattern, string replacement, string matchingType = null)
        {
            FileNameReplacer found = this.options.FileNameReplacer.FirstOrDefault(x => x.Key == key);

            if (found == null)
            {
                this.options.AddFileNameReplace(new FileNameReplacer(key, pattern, replacement, matchingType));
            }
            else
            {
                found.SetPattern(pattern).SetReplacement(replacement).SetMatchingType(matchingType);
            }
            return(this);
        }
Example #3
0
 public static FileNameReplacer SetMatchingType(this FileNameReplacer replacer, string matchingType)
 {
     replacer.MatchingType = matchingType;
     return(replacer);
 }
Example #4
0
 public static FileNameReplacer SetReplacement(this FileNameReplacer replacer, string replacement)
 {
     replacer.Replacement = replacement;
     return(replacer);
 }
Example #5
0
 public static FileNameReplacer SetPattern(this FileNameReplacer replacer, string pattern)
 {
     replacer.Pattern = pattern;
     return(replacer);
 }