private void postProcess(Substitution substitution) { if (TagFormatted == null) { return; } TagFormattedEventArgs args = new TagFormattedEventArgs(substitution.Key, substitution.Substitute, substitution.IsExtension); TagFormatted(this, args); substitution.Substitute = args.Substitute; }
void IMustacheGenerator.GetText(TextWriter writer, Scope scope, Scope context, Action <Substitution> postProcessor) { object value = _isVariable ? context.Find(_key, _isExtension) : scope.Find(_key, _isExtension); string result = String.Format(writer.FormatProvider, _format, value); Substitution substitution = new Substitution() { Key = _key, Substitute = result, IsExtension = _isExtension }; postProcessor(substitution); writer.Write(substitution.Substitute); }