public VariableFormatSpecifier(StaticFormatSpecifier defaultFormatSpecifier, Func<string, StaticFormatSpecifier, StaticFormatSpecifier> getFormatSpecifier) { DefaultFormatSpecifier = defaultFormatSpecifier; if (getFormatSpecifier == null) throw new ArgumentNullException("getFormatSpecifier.", "VariableFormatSpecifier is missing Tag-to-FormatSpecifier function."); GetFormatSpecifier = getFormatSpecifier; }
public VariableFormatSpecifier(StaticFormatSpecifier defaultFormatSpecifier, Func <string, StaticFormatSpecifier, StaticFormatSpecifier> getFormatSpecifier) { DefaultFormatSpecifier = defaultFormatSpecifier; if (getFormatSpecifier == null) { throw new ArgumentNullException("getFormatSpecifier.", "VariableFormatSpecifier is missing Tag-to-FormatSpecifier function."); } GetFormatSpecifier = getFormatSpecifier; }
public override FormatSpecifier Recalc(string tag) { if (string.IsNullOrEmpty(tag)) { return(this); } StaticFormatSpecifier newFormatSpecifier = GetFormatSpecifier(tag, DefaultFormatSpecifier); if (newFormatSpecifier == null) { return(this); } return(new VariableFormatSpecifier(newFormatSpecifier, GetFormatSpecifier)); }