PostSharpAPI ReferencePost­Sharp.​Patterns.​ModelAggregatable­Attribute­Target­ClassOn­Ancestor­Changed
Open sandboxFocus

AggregatableAttributeTargetClass.OnAncestorChanged Method


Method invoked when an ancestor of the current object has changed. Implement this method only if the target class of AggregatableAttribute implements the IAggregatable interface. For other use cases, subscribe to the AncestorChanged event.

protected virtual void OnAncestorChanged(AncestorChangedEventArgs args)
Type Name Description
AncestorChangedEventArgs args

An instance of AncestorChangedEventArgs whose Child property indicates which object had its Parent modified, or null if this object is the current object.


This method will be invoked only if there is at least one subscriber to the AncestorChanged event, unless the object whose Parent property has been modified is the current object.

The AggregatableAttribute aspect will not override this method if it already exists. However, it will use it to raise the AncestorChanged event.

This method should raise the AncestorChanged event. If args is null, a new instance of the AncestorChangedEventArgs class should be created, passing the current object as the constructor argument.