Open sandboxFocus

Interface IAggregatable

Defines members (principally Parent and VisitChildren(ChildVisitor, ChildVisitorOptions, object)) that make it possible to consume parent-child relationships in an object tree.

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Aggregation.dll
Syntax
public interface IAggregatable
Remarks

If a class implements this interface, it must also implement IAttachable. These two interfaces have been separated for clarity, since IAttachable should normally not be consumed from user code.

The AggregatableAttribute aspect introduces this interface after compilation, so the C# compiler does not know that the target class implements it. To get the interface from source code, use Cast<TSource, TTarget>(TSource) or QueryInterface<T>(object, bool). Advisable collections, such as AdvisableCollection<T>, receive this interface at run time, so only QueryInterface<T>(object, bool) can return it.

Properties

Name Description
Parent

Gets the parent of the current object.

ParentRelationship

Gets the relationship between the current object and its parent. Valid values are Child or ParentSurrogate.

Methods

Name Description
VisitChildren(ChildVisitor, ChildVisitorOptions, object)

Executes an action for all direct children of the current object.

Events

Name Description
AncestorChanged

Occurs when any ancestor changes. An ancestor is the parent of the current object or the parent of an ancestor of the current object.

ParentChanged

Occurs when the Parent property changes.

Extension Methods

See Also