public string GetListAsHtml(List list)
{
string html = "<";
try
{
if (list != null)
{
if (list.ListType == ListStyles.Number)
html += "ol>\n";
else
html += "ul>\n";
if (list.Content != null)
{
foreach(IContent iContent in list.Content)
html += this.GetIContentCollectionAsHtml(list.Content);
}
}
}
catch(Exception ex)
{
throw new AODLException("Exception while trying to build a HTML string from a List object.", ex);
}
if (html.StartsWith("<ol"))
html += "</ol>\n";
else if (html.StartsWith("<ul"))
html += "</ul>\n";
else
html = "";
return html;
}