PostSharpAPI ReferencePost­Sharp.​Patterns.​Model.​Type­AdaptersType­Adapter
Open sandboxFocus

TypeAdapter Class

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

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

Type adapters must be registered using the RegisterTypeAdapterAttribute custom attribute.

Constructors

Name Description
TypeAdapter(Boolean)

Initializes a new TypeAdapter for no specific type.

TypeAdapter(Type)

Initializes a new TypeAdapter 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

Determines which kind of relationships the adapted type can enter with respect to the parent object.

IsAnyInstanceImmutable

Determines whether any instance of this type or of any derived class is immutable.

IsAnyInstanceThreadSafe

Determines whether any instance of this type or of any derived class can be safely shared by several threads.

IsImmutable

Determines whether the adapted type is immutable.

IsThreadSafe

Determines 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)

Visit children or collection items.