protected override void VisitAttribute(DomAttribute attribute) { string parent = stack.Peek(); CurrentOutput.WriteLine("{0}.Attribute(\"{1}\", \"{2}\");", parent, CodeUtility.Escape(attribute.Name), CodeUtility.Escape(attribute.Value)); }
protected override void VisitText(HxlTextElement element) { // These should have been converted to render islands, BUT there are a few // cases where we want to keep an object: // - parent is retained (easier to work with) // - only writing a space or tab (no need for the overhead) string parent = stack.Peek(); CurrentOutput.WriteLine("{0}.AppendText(\"{1}\");", parent, CodeUtility.Escape(element.Data)); }
void IHxlTemplateEmitter.EmitLiteral(string text) { if (string.IsNullOrEmpty(text)) { return; } sb.AppendSeparator(", "); sb.Append("\"" + CodeUtility.Escape(text) + "\""); }
protected override void VisitConstantExpression(ConstantExpression expression) { var str = expression.Value as string; if (str != null) { Output.Write("\"{0}\"", CodeUtility.Escape(str)); return; } base.VisitConstantExpression(expression); }
protected override void VisitText(DomText text) { string parent = stack.Peek(); CurrentOutput.WriteLine("{0}.AppendText(\"{1}\");", parent, CodeUtility.Escape(text.Data)); }
public IEnumerable <string> Start(HxlTextElement e) { yield return(string.Format( "__self.Write(\"{0}\");", CodeUtility.Escape(e.Data))); }