public string GetTextStyleAsHtml(TextProperties textStyle)
{
string style = "style=\"";
try
{
if (textStyle != null)
{
if (textStyle.Italic != null)
if (textStyle.Italic != "normal")
style += "font-style: italic; ";
if (textStyle.Bold != null)
style += "font-weight: "+textStyle.Bold+"; ";
if (textStyle.Underline != null)
style += "text-decoration: underline; ";
if (textStyle.TextLineThrough != null)
style += "text-decoration: line-through; ";
if (textStyle.FontName != null)
style += "font-family: "+FontFamilies.HtmlFont(textStyle.FontName)+"; ";
if (textStyle.FontSize != null)
style += "font-size: "+FontFamilies.PtToPx(textStyle.FontSize)+"; ";
if (textStyle.FontColor != null)
style += "color: "+textStyle.FontColor+"; ";
if (textStyle.BackgroundColor != null)
style += "background-color: "+textStyle.BackgroundColor+"; ";
}
}
catch(Exception ex)
{
throw new AODLException("Exception while trying to build a HTML style string from a TextStyle.", ex);
}
if (!style.EndsWith("; "))
style = "";
else
style += "\"";
return style;
}