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); }
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); }
public static FileNameReplacer SetMatchingType(this FileNameReplacer replacer, string matchingType) { replacer.MatchingType = matchingType; return(replacer); }
public static FileNameReplacer SetReplacement(this FileNameReplacer replacer, string replacement) { replacer.Replacement = replacement; return(replacer); }
public static FileNameReplacer SetPattern(this FileNameReplacer replacer, string pattern) { replacer.Pattern = pattern; return(replacer); }