public Paragraph CreateParagraph(XmlNode paragraphNode)
{
try
{
//Create a new Paragraph
Paragraph paragraph = new Paragraph(paragraphNode, this._document);
//Recieve the ParagraphStyle
IStyle paragraphStyle = this._document.Styles.GetStyleByName(paragraph.StyleName);
if (paragraphStyle != null)
{
paragraph.Style = paragraphStyle;
}
else if (paragraph.StyleName != "Standard"
&& paragraph.StyleName != "Table_20_Contents"
&& paragraph.StyleName != "Text_20_body"
&& this._document is TextDocument)
{
//Check if it's a user defined style
IStyle commonStyle = this._document.CommonStyles.GetStyleByName(paragraph.StyleName);
if (commonStyle == null)
{
this.OnWarning(new AODLWarning(string.Format(
"A ParagraphStyle '{0}' wasn't found.", paragraph.StyleName), paragraph.Node));
}
}
return this.ReadParagraphTextContent(paragraph);
}
catch(Exception ex)
{
throw new AODLException("Exception while trying to create a Paragraph.", ex);
}
}