public void TypedAccess()
{
Document doc = new Document();
//ExStart
//ExFor:Story.Tables
//ExFor:Table.FirstRow
//ExFor:Table.LastRow
//ExFor:TableCollection
//ExId:TypedPropertiesAccess
//ExSummary:Demonstrates how to use typed properties to access nodes of the document tree.
// Quick typed access to the first child Section node of the Document.
Section section = doc.FirstSection;
// Quick typed access to the Body child node of the Section.
Body body = section.Body;
// Quick typed access to all Table child nodes contained in the Body.
TableCollection tables = body.Tables;
foreach (Table table in tables)
{
// Quick typed access to the first row of the table.
if (table.FirstRow != null)
table.FirstRow.Remove();
// Quick typed access to the last row of the table.
if (table.LastRow != null)
table.LastRow.Remove();
}
//ExEnd
}