Method GetElementsRecursively
- Namespace
- MigraDoc.DocumentObjectModel.Visitors
- Assembly
- MigraDoc.DocumentObjectModel.dll
GetElementsRecursively(DocumentObject, bool)
Gets the elements/sections/rows/cells of a DocumentObject recursively.
public static IEnumerable<DocumentObject?> GetElementsRecursively(this DocumentObject documentObject, bool includeHeaderFooter = false)
Parameters
documentObjectDocumentObjectThe DocumentObject.
includeHeaderFooterboolShall headers and footers also be returned. No effect for DocumentObjects that neither are nor contain Sections.
Returns
- IEnumerable<DocumentObject>
GetElementsRecursively(DocumentObject, List<Type>, bool, bool)
Gets the elements/sections/rows/cells of a DocumentObject recursively, stopping recursion at elements of the Types listed in stopAtItems.
public static IEnumerable<DocumentObject?> GetElementsRecursively(this DocumentObject documentObject, List<Type> stopAtElements, bool includeStoppingElements = false, bool includeHeaderFooter = false)
Parameters
documentObjectDocumentObjectThe DocumentObject.
stopAtElementsList<Type>A list with types the recursion shall stop at.
includeStoppingElementsboolIf false, the stopping element and its children are not returned. If true, the stopping element is returned, but its children are not.
includeHeaderFooterboolShall headers and footers also be returned. No effect for DocumentObjects that neither are nor contain Sections.
Returns
- IEnumerable<DocumentObject>
GetElementsRecursively<T>(DocumentObject, bool)
Gets the elements/sections/rows/cells of Type T of a DocumentObject recursively.
public static IEnumerable<T> GetElementsRecursively<T>(this DocumentObject documentObject, bool includeHeaderFooter = false) where T : DocumentObject
Parameters
documentObjectDocumentObjectThe DocumentObject.
includeHeaderFooterboolShall headers and footers also be returned. No effect for DocumentObjects that neither are nor contain Sections.
Returns
- IEnumerable<T>
Type Parameters
T