Custom attribute that, when applied to class, enables instances of this class to be involved in a parent-child relationship.
Inheritance
Implements
Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Aggregation.dll
Syntax
[IntroduceInterface(typeof(IAttachable), OverrideAction = InterfaceOverrideAction.Ignore, AncestorOverrideAction = InterfaceOverrideAction.Ignore, LinesOfCodeAvoided = 0)]
[MulticastAttributeUsage(MulticastTargets.Class, TargetTypeAttributes = MulticastAttributes.UserGenerated)]
[AspectTypeDependency(AspectDependencyAction.Conflict, typeof(AggregatableAttribute))]
[AspectRoleDependency(AspectDependencyAction.Order, AspectDependencyPosition.After, "Tracing")]
[AspectRoleDependency(AspectDependencyAction.Order, AspectDependencyPosition.Before, "Validation")]
[Serializer(typeof(AggregatableAttribute.Serializer))]
public sealed class AggregatableAttribute : InstanceLevelAspect, ITypeLevelAspect, ITypeLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation, ICloneAwareAspect, IInstanceScopedAspect, IAttachable, IAggregatable, IAdviceProvider, IAspectProvider, IAspect, IService, IDeserializationCallbackRemarks
<p>This aspect implements the <xref href="PostSharp.Patterns.Model.IAggregatable" data-throw-if-not-resolved="false"></xref> interface, which exposes members such as <xref href="PostSharp.Patterns.Model.IAggregatable.VisitChildren(PostSharp.Patterns.Model.ChildVisitor%2cPostSharp.Patterns.Model.ChildVisitorOptions%2cSystem.Object)" data-throw-if-not-resolved="false"></xref>
and Parent.
The AggregatableAttribute aspect is implicitly used by several other aspects, including all threading models.
When a class has the AggregatableAttribute aspect, its reference-type fields and automatic properties must be annotated with one of the following attributes: ChildAttribute, ReferenceAttribute or ParentAttribute.
Target classes can customize the AggregatableAttribute aspect by implementing one or many of the members documented in the PostSharp.Patterns.Model.AggregatableAttributeTargetClass class.
Constructors
| Name | Description |
|---|---|
| AggregatableAttribute() | Initializes a new instance of the AggregatableAttribute class. |
| AggregatableAttribute(PortableFormatterConstructorContext) |
Properties
| Name | Description |
|---|---|
| ChildrenFields | Gets (at build time) the list of children fields together with their ChildInfo. |
| DefaultItemRelationship | Gets or sets the default kind of relationship for collection items. |
| DefaultMemberRelationship | Gets or sets the default kind of relationship of fields and automatic properties. |
| IsParentSurrogate | Determines whether instances of the target class of this custom attribute are parent surrogates. |
| IsParentSurrogateSpecified | Determines whether the IsParentSurrogate property has been set. |