Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        void IHxlTemplateEmitter.EmitLiteral(string text)
        {
            if (string.IsNullOrEmpty(text))
            {
                return;
            }

            sb.AppendSeparator(", ");
            sb.Append("\"" + CodeUtility.Escape(text) + "\"");
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        protected override void VisitText(DomText text)
        {
            string parent = stack.Peek();

            CurrentOutput.WriteLine("{0}.AppendText(\"{1}\");", parent, CodeUtility.Escape(text.Data));
        }
Ejemplo n.º 6
0
 public IEnumerable <string> Start(HxlTextElement e)
 {
     yield return(string.Format(
                      "__self.Write(\"{0}\");", CodeUtility.Escape(e.Data)));
 }