Open sandboxFocus

Method AttachToParent

AttachToParent(RelationshipInfo, IAttacher, object)

Attaches the current object to a parent object.

Declaration
bool AttachToParent(RelationshipInfo relationshipInfo, IAttacher attacher, object attacherState)
Parameters
Type Name Description
RelationshipInfo relationshipInfo

Information about the relationship of the parent node relatively to the current node. The Relationship property must be set to Child or ParentSurrogate.

IAttacher attacher

A service that allows the current node to attach itself to the parent.

object attacherState

An opaque state object to be passed as the first argument to all methods of the IAttacher interface.

Returns
Type Description
bool

true if the current object was not previously attached to any parent, false if it was already attached to the same parent.

Remarks

In case a child is attached to its parent through several relationships, all relationships should have the same characteristics, i.e. their RelationshipInfo value should be identical.