Open sandboxFocus

Class TypeAdapter

Adapter that implements the features otherwise added by AggregatableAttribute to external or third-party types.

Inheritance
TypeAdapter
Namespace: PostSharp.Patterns.Model.TypeAdapters
Assembly: PostSharp.Patterns.Aggregation.dll
Syntax
public class TypeAdapter
Remarks

Type adapters must be registered using the RegisterTypeAdapterAttribute custom attribute.

Constructors

Name Description
TypeAdapter(bool)

Initializes a new instance of the TypeAdapter class for no specific type.

TypeAdapter(Type)

Initializes a new instance of the TypeAdapter class for a specific AdaptedType.

Properties

Name Description
AdaptedType

Gets the AdaptedType adapted by the current TypeAdapter, or null if the current TypeAdapter is not specific to any AdaptedType.

EligibleRelationshipKind

Gets the kind of relationship that the adapted type can enter with respect to the parent object.

IsAnyInstanceImmutable

Gets a value indicating whether any instance of this type or of any derived class is immutable.

IsAnyInstanceThreadSafe

Gets a value indicating whether any instance of this type or of any derived class can be safely shared by several threads.

IsImmutable

Gets a value indicating whether the adapted type is immutable.

IsThreadSafe

Gets a value indicating whether instances of this type can be safely shared by several threads.

ObjectReferenceTypes

Gets a list of all types referenced from the adapted type.

Methods

Name Description
AttachChild(object, RelationshipInfo, IAttacher, object)

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.

AttachToParent(object, RelationshipInfo, IAttacher, object)

Attaches an object to a parent object.

DetachChild(object, object, RelationshipInfo)

Detaches an item from its parent. This method is typically invoked by implementations of DetachFromParent(object, object, RelationshipInfo) to detach items or children from the parent.

DetachFromParent(object, object, RelationshipInfo)

Detaches an object from its parent object.

VisitChildren(object, ChildVisitor, ChildVisitorOptions, object)

Visits children or collection items.