Alsing.SourceCode.SyntaxDocumentExporters.CollapsingHTMLExporter.write C# (CSharp) Method

write() private method

private write ( string text, TextStyle s ) : void
text string
s TextStyle
return void
        private void write(string text, TextStyle s)
        {
            if (s != null)
            {
                if (s.Bold)
                    Out("<b>");
                if (s.Italic)
                    Out("<i>");
                if (s.Transparent)
                    Out("<span style=\"color:" + GetHTMLColor(s.ForeColor) + "\">");
                else
                    Out("<span style=\"color:" + GetHTMLColor(s.ForeColor) +
                        ";background-color:" + GetHTMLColor(s.BackColor) + ";\">");
            }

            text = text.Replace("&", "&amp;");
            text = text.Replace("<", "&lt;");
            text = text.Replace(">", "&gt;");
            text = text.Replace(" ", "&nbsp;");
            text = text.Replace("\t", "&nbsp;&nbsp;&nbsp;&nbsp;");
            Out(text);

            if (s != null)
            {
                Out("</span>");

                if (s.Italic)
                    Out("</i>");
                if (s.Bold)
                    Out("</b>");
            }
        }