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
This aspect implements the IAggregatable interface, which exposes members such as VisitChildren(ChildVisitor, ChildVisitorOptions, object) and Parent.
<p>The <xref href="PostSharp.Patterns.Model.AggregatableAttribute" data-throw-if-not-resolved="false"></xref> aspect is implicitly used by several other aspects, including all threading models.</p><p>When a class has the <xref href="PostSharp.Patterns.Model.AggregatableAttribute" data-throw-if-not-resolved="false"></xref> aspect, its reference-type fields and automatic properties must be annotated
with one of the following attributes: <xref href="PostSharp.Patterns.Model.ChildAttribute" data-throw-if-not-resolved="false"></xref>, <xref href="PostSharp.Patterns.Model.ReferenceAttribute" data-throw-if-not-resolved="false"></xref> or <xref href="PostSharp.Patterns.Model.ParentAttribute" data-throw-if-not-resolved="false"></xref>. </p></p>
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. |