internal abstract void WriteTo(HtmlWriter writer);
Ejemplo n.º 2
0
        internal override void WriteTo(HtmlWriter writer)
        {
            if (IsType("br"))
            {
                writer.Write("<br />");
                return;
            }
            else if (IsType("hr"))
            {
                writer.Write("<hr />");
                return;
            }

            writer.Write("<");
            writer.Write(Name.ToLower());
            foreach (var key in Attributes.Keys)
            {
                writer.Write(" ");
                writer.WriteFormat(" {0}=\"{1}\"", key, Attributes[key]);
            }

            if (Closed)
            {
                writer.Write(" />");
            }
            else
            {
                writer.Write(">");
                if (ChildElements.Count > 1)
                {
                    writer.NewLine();
                    if (!IsType("html"))
                        writer.Increment();
                    foreach (var childElement in ChildElements)
                    {
                        childElement.WriteTo(writer);
                        writer.NewLine();
                    }
                    if (!IsType("html"))
                        writer.Decrement();
                }
                else
                {
                    foreach (var childElement in ChildElements)
                        childElement.WriteTo(writer);
                }
                if (EndTag != null)
                    writer.WriteFormat("</{0}>", Name.ToLower());
            }
        }
Ejemplo n.º 3
0
 private void RenderOutput(HtmlWriter writer)
 {
     foreach (var control in _dataFields)
         writer.AddAttribute("umb_" + control.ID, ((IMacroGuiRendering)control).Value);
     writer.AddAttribute("umb_macroalias", MacroAlias);
     writer.AddAttribute("ismacro", "true");
     writer.AddAttribute("onresizestart", "return false;");
     writer.AddAttribute("umbversionid", "cc9ae04b-c494-4692-a4b9-c20416b050b1");
     writer.AddAttribute("umbpageid", Request.QueryString["id"]);
     writer.AddAttribute(HtmlTextWriterAttribute.Title, "This is rendered content from macro");
     writer.RenderBeginTag(HtmlTextWriterTag.Div, "umbMacroHolder");
     writer.AddAttribute(HtmlTextWriterAttribute.Style, "color: green;");
     writer.RenderBeginTag(HtmlTextWriterTag.Span);
     writer.Write("<!-- startUmbMacro --><span style=\"color: green;\">");
     writer.RenderFullTag(HtmlTextWriterTag.Strong, "Block Quote Macro");
     writer.WriteBreak();
     writer.Write("No macro content available for WYSIWYG editing");
     writer.RenderEndTag(); // span
     writer.Write("<!-- endUmbMacro -->");
     writer.RenderEndTag(); // div.umbMacroHolder
 }
Ejemplo n.º 4
0
 public override string ToString()
 {
     var writer = new HtmlWriter();
     WriteTo(writer);
     return writer.ToString();
 }
Ejemplo n.º 5
0
 internal override void WriteTo(HtmlWriter writer)
 {
     //writer.Decrement();
     //writer.WriteFormat("</{0}>", TagName);
     //writer.NewLine();
 }