EnumerateActionTree(Int32) Method

Definition

Namespace Broadside
Assembly Broadside.dll

Enumerates this action and every action after it, depth first in the order they would be performed: this action, then each action of its Next followed by that action's own tree (§12.6.2, Note 1).

public IEnumerable<PdfAction> EnumerateActionTree(int maxDepth = 64)

Parameters

maxDepth
Int32

How many Next levels below this action to follow; deeper actions are cut with an ActionTreeTooDeep diagnostic.

Returns

IEnumerable<PdfAction>
The actions, read lazily as the enumeration advances.

Remarks

ISO 32000-2 §12.6.2, Note 1: "self-referential actions ought not be executed more than once". Each action dictionary is yielded once, at its first position: an action reached again (shared by two branches, or a cycle) is not repeated, and a cycle, legal but anomalous, is recorded as an ActionCycle diagnostic of severity Information. The walk is iterative and never writes to the dictionaries.