PostSharpAPI ReferencePost­Sharp.​Patterns.​Model.​Type­AdaptersType­AdapterDetach­From­Parent
Open sandboxFocus

TypeAdapter.DetachFromParent Method

DetachFromParent(Object, Object, RelationshipInfo)

Detaches an object from its parent object.

public virtual bool DetachFromParent(object obj, object parent, RelationshipInfo relationshipInfo)
Type Name Description
Object obj

An instance of the adapted type.

Object parent

The object from which obj is detached.

RelationshipInfo relationshipInfo

Relationship of obj with respect to parent.

Type Description

true if the current object has been fully detached, i.e. is no longer attached to its parent by any other relationship, or false if the current object is still attached to the parent by some relationship.


This method is equivalent to DetachFromParent().

Implementations of this method can use the DetachChild(Object, Object, RelationshipInfo) method to detach items from the parent.