PostSharp6.0/API Reference/Post­Sharp.​Patterns.​Model Namespace/IAggregatable Interface/IAggregatable Methods/IAggregatable.​Visit­Children Method

IAggregatable.VisitChildren Method

Executes an action for all direct children of the current object.

Namespace:  PostSharp.Patterns.Model
Assembly:  PostSharp.Patterns.Aggregation (in PostSharp.Patterns.Aggregation.dll) Version: 6.1.6.0 (6.1.6.0)
Syntax
C#
bool VisitChildren(
	ChildVisitor visitor,
	ChildVisitorOptions options = ChildVisitorOptions.None,
	Object state = null
)

Parameters

visitor
Type: PostSharp.Patterns.Model.ChildVisitor
The action to be executed for each child.
options (Optional)
Type: PostSharp.Patterns.Model.ChildVisitorOptions
Options. The default behavior is to enumerate all children, but ignore parent surrogates.
state (Optional)
Type: System.Object

Return Value

Type: Boolean
false if visitor returned Stop, otherwise true.
Remarks
Note Note
If a parent is bound to a child through several relationships (for instance several fields), the visitor delegate will be invoked several times, once for each relationship. Store visited children into a HashSet<T> if you need to perform an action only once per child.
See Also