IAttacher.AttachChild Method |
Attach an object as a child of the current node.
Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Aggregation (in PostSharp.Patterns.Aggregation.dll) Version: 2023.0.3.0 (2023.0.3.0)
C#
Object AttachChild( Object state, Object child, ChildInfo childInfo )
Parameters
- state
- Type: System.Object
The opaque state object passed to AttachToParent(RelationshipInfo, IAttacher, Object). - child
- Type: System.Object
The object that must be attached as a child to the current node. - childInfo
- Type: PostSharp.Patterns.Model.ChildInfo
Information about the location (field or collection item, typically) to which the child is assigned and about the relationship of the current node relatively to the parent node. The Relationship property must be set to Child or ParentSurrogate
Return Value
Type: ObjectThe new parent of child, or null if child was already attached to the same parent node through another relationship. If the current node is a parent surrogate, the method returns the parent of the current node.
The new parent of child will be the current node (the value returned by GetNode(Object));
or the parent of the current node, if the current node is a parent surrogate.