public string GetIContentCollectionAsHtml(ContentCollection iContentCollection)
{
string html = "";
try
{
if (iContentCollection != null)
{
foreach(IContent iContent in iContentCollection)
{
//determine type
if (iContent is Table)
html += this.GetTableAsHtml(iContent as Table);
else if (iContent is ODFControlRef)
html += this.GetODFControlAsHtml(iContent as ODFControlRef);
else if (iContent is Field)
html += this.GetFieldAsHtml(iContent as Field);
else if (iContent is Paragraph)
html += this.GetParagraphAsHtml(iContent as Paragraph);
else if (iContent is List)
html += this.GetListAsHtml(iContent as List);
else if (iContent is Frame)
html += this.GetDrawFrameAsHtml(iContent as Frame);
else if (iContent is DrawTextBox)
html += this.GetDrawTextBoxAsHtml(iContent as DrawTextBox);
else if (iContent is Graphic)
html += this.GetGraphicAsHtml(iContent as Graphic);
else if (iContent is ListItem)
html += this.GetListItemAsHtml(iContent as ListItem);
else if (iContent is Header)
html += this.GetHeadingAsHtml(iContent as Header);
else if (iContent is TableOfContents)
html += this.GetTableOfContentsAsHtml(iContent as TableOfContents);
else if (iContent is UnknownContent)
html += this.GetUnknowContentAsHtml(iContent as UnknownContent);
else if (iContent is ImageMap)
html += this.GetImageMapAsHtml(iContent as ImageMap);
else if (iContent is DrawArea)
html += this.GetDrawAreaAsHtml(iContent as DrawArea);
else
//this should never happens, because all not implemented elements
//are unknwon content
if (OnWarning != null)
{
AODLWarning warning = new AODLWarning("Finding total unknown content. This should (could) never happen.");
//warning.InMethod = AODLException.GetExceptionSourceInfo(new StackFrame(1, true));
OnWarning(warning);
}
}
}
}
catch(Exception ex)
{
throw new AODLException("Exception while trying to build a HTML string from an IContentCollection.", ex);
}
return html;
}