Open sandboxFocus

Class RecordableAttribute

Custom attribute that, when applied to a class, instruments fields and methods of this class so that it can be involved in undo/redo operations.

Namespace: PostSharp.Patterns.Recording
Assembly: PostSharp.Patterns.Model.dll
Syntax
[IntroduceInterface(typeof(IRecordable), OverrideAction = InterfaceOverrideAction.Ignore, AncestorOverrideAction = InterfaceOverrideAction.Ignore)]
[IntroduceInterface(typeof(IQueryInterface), OverrideAction = InterfaceOverrideAction.Ignore, AncestorOverrideAction = InterfaceOverrideAction.Ignore)]
[MulticastAttributeUsage(MulticastTargets.Class, Inheritance = MulticastInheritance.Strict, AllowMultiple = false, TargetTypeAttributes = MulticastAttributes.UserGenerated)]
[Metric("UsedFeatures", "PostSharp.Patterns.Recording.Recordable")]
[ProvideAspectRole("ChangeTracking")]
[AspectRoleDependency(AspectDependencyAction.Order, AspectDependencyPosition.After, "Tracing")]
[AspectRoleDependency(AspectDependencyAction.Order, AspectDependencyPosition.After, "Threading")]
[AspectRoleDependency(AspectDependencyAction.Order, AspectDependencyPosition.After, "Validation")]
[AspectRoleDependency(AspectDependencyAction.Order, AspectDependencyPosition.After, "Caching")]
[AspectRoleDependency(AspectDependencyAction.Order, AspectDependencyPosition.After, "CacheInvalidation")]
[AspectRoleDependency(AspectDependencyAction.Order, AspectDependencyPosition.After, "ThreadingModel")]
[AspectTypeDependency(AspectDependencyAction.Order, AspectDependencyPosition.After, typeof(AggregatableAttribute))]
[AspectRoleDependency(AspectDependencyAction.Order, AspectDependencyPosition.Before, "DataBinding")]
[AspectRoleDependency(AspectDependencyAction.Commute, "EditableObjectImplementation")]
[AspectTypeDependency(AspectDependencyAction.Conflict, typeof(RecordableAttribute))]
[Serializer(typeof(RecordableAttribute.Serializer))]
public sealed class RecordableAttribute : InstanceLevelAspect, ITypeLevelAspect, ITypeLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation, ICloneAwareAspect, IInstanceScopedAspect, IRecordable, IAspectProvider, IAspect, IService, IQueryInterface, IDynamicInterfaceImplementation

Constructors

Name Description
RecordableAttribute()

Initializes a new instance of the RecordableAttribute class.

RecordableAttribute(PortableFormatterConstructorContext)

Properties

Name Description
AutoRecord

Determines whether changes in this object must be recorded as soon as the object constructor has completed.

ProvideMethodContext

Determines whether full method invocation context is provided to the MethodExecutionOperationDescriptor class for use in a custom OperationFormatter. This property is set to false by default for performance reasons.

Methods

Name Description
CompileTimeInitialize(Type, AspectInfo)

Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.

CompileTimeValidate(Type)

Method invoked at build time to ensure that the aspect has been applied to the right target.

See Also