PostSharpAPI ReferencePost­Sharp.​Patterns.​ModelIAttacherAttach­Child
Open sandboxFocus

IAttacher.AttachChild Method

AttachChild(Object, Object, ChildInfo)

Attach an object as a child of the current node.

Declaration
object AttachChild(object state, object child, ChildInfo childInfo)
Parameters
Type Name Description
Object state

The opaque state object passed to AttachToParent(RelationshipInfo, IAttacher, Object).

Object child

The object that must be attached as a child to the current node.

ChildInfo 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

Returns
Type Description
Object

The 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.

Remarks

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.