/// <summary>
/// Updates the left, right and content indentation of all RtfParagraph and RtfSection
/// elements that this RtfSection contains.
/// </summary>
/// <param name="indentLeft">The left indentation to add.</param>
/// <param name="indentRight">The right indentation to add.</param>
/// <param name="indentContent">The content indentation to add.</param>
private void updateIndentation(float indentLeft, float indentRight, float indentContent)
{
if (Title != null)
{
Title.SetIndentLeft((int)(Title.GetIndentLeft() + indentLeft * TWIPS_FACTOR));
Title.SetIndentRight((int)(Title.GetIndentRight() + indentRight * TWIPS_FACTOR));
}
for (int i = 0; i < Items.Count; i++)
{
IRtfBasicElement rtfElement = (IRtfBasicElement)Items[i];
if (rtfElement is RtfSection)
{
((RtfSection)rtfElement).updateIndentation(indentLeft + indentContent, indentRight, 0);
}
else if (rtfElement is RtfParagraph)
{
((RtfParagraph)rtfElement).SetIndentLeft((int)(((RtfParagraph)rtfElement).GetIndentLeft() + (indentLeft + indentContent) * TWIPS_FACTOR));
((RtfParagraph)rtfElement).SetIndentRight((int)(((RtfParagraph)rtfElement).GetIndentRight() + indentRight * TWIPS_FACTOR));
}
}
}