internal abstract void WriteTo(HtmlWriter writer);
        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());
            }
        }
Esempio 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
 }
 public override string ToString()
 {
     var writer = new HtmlWriter();
     WriteTo(writer);
     return writer.ToString();
 }
 internal override void WriteTo(HtmlWriter writer)
 {
     //writer.Decrement();
     //writer.WriteFormat("</{0}>", TagName);
     //writer.NewLine();
 }