PostSharp6.6//API Reference/Post­Sharp.​Patterns.​Model.​Type­Adapters Namespace/Type­Adapter Class/Type­Adapter Methods/Type­Adapter.​Attach­Child Method

TypeAdapter.AttachChild Method

Attaches an item to a parent. This method is typically invoked by implementations of AttachToParent(Object, RelationshipInfo, IAttacher, Object) to attach items or children to the parent.

Namespace:  PostSharp.Patterns.Model.TypeAdapters
Assembly:  PostSharp.Patterns.Aggregation (in PostSharp.Patterns.Aggregation.dll) Version: 6.6.7.0 (6.6.7.0)
Syntax
C#
protected bool AttachChild(
	Object item,
	RelationshipInfo relationshipInfo,
	IAttacher attacher,
	Object attacherState
)

Parameters

item
Type: System.Object
The object to attach.
relationshipInfo
Type: PostSharp.Patterns.Model.RelationshipInfo
Relationship of item with respect to the object represented by attacher and attacherState.
attacher
Type: PostSharp.Patterns.Model.IAttacher
An interface that represents to parent's ability to attach children.
attacherState
Type: System.Object
An opaque state object to be passed to attacher.

Return Value

Type: Boolean
true if the current object was not previously attached to any parent, false if it was already attached to the same parent.
See Also