public string GetHtml()
{
string html = "<p ";
string textStyle = null;
bool useSpan = false;
bool useGlobal = false;
if (this.Style != null)
{
if (((ParagraphStyle)this.Style).ParentStyle == "Heading"
&& this.ParagraphStyle.ParagraphProperties == null
&& this.ParagraphStyle.TextProperties == null)
useGlobal = true;
else
{
if (this.ParagraphStyle.ParagraphProperties != null)
html += this.ParagraphStyle.ParagraphProperties.GetHtmlStyle();
if (this.ParagraphStyle.TextProperties != null)
{
textStyle = this.ParagraphStyle.TextProperties.GetHtmlStyle();
if (textStyle.Length > 0)
{
html += "<span "+textStyle;
useSpan = true;
}
}
}
}
else
useGlobal = true;
if (useGlobal)
{
string global = this.GetHtmlStyleFromGlobalStyles();
if (global.Length > 0)
html += global;
}
html += ">\n";
//There check all content if they
//support HTML
foreach(object content in this._mixedContent)
{
if (content is IHtml)
{
string text = ((IHtml)content).GetHtml();
html += text;
}
}
if (useSpan)
return html +"</span> </p>\n";
else
return html +" </p>\n";
// if (this.TextContent.Count > 0)
// {
// if (useSpan)
// return html + this.GetTextHtmlContent()+"</span></p>\n";
// else
// return html + this.GetTextHtmlContent()+"</p>\n";
// }
// else
// {
// string text = this.GetContentHtmlContent();
// text = (text!=String.Empty) ? text : " ";
//
// if (useSpan)
// return html + text +"</span></p>\n";
// else
// return html + text +"</p>\n";
// }
}