PostSharpAPI ReferencePost­Sharp.​Patterns.​RecordingEditable­Object­Attribute
Open sandboxFocus

EditableObjectAttribute Class

Custom attribute that, when applied to a class, implements IEditableObject into this class.

Namespace: PostSharp.Patterns.Recording
Assembly: PostSharp.Patterns.Model.dll
Syntax
[MulticastAttributeUsage]
[IntroduceInterface]
[Metric("UsedFeatures", "PostSharp.Patterns.Recording.EditableObject")]
[AspectTypeDependency]
[Serializer]
public sealed class EditableObjectAttribute : InstanceLevelAspect, ITypeLevelAspect, ITypeLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation, ICloneAwareAspect, IInstanceScopedAspect, IAspectProvider, IAspect, IService
Remarks

This aspect implicitly adds the RecordableAttribute aspect to the target class, unless the aspect is already applied to this class.

The aspect is implemented by creating a restore point using the AddRestorePoint(String) method in the BeginEdit() method, and undo using UndoTo(Operation) when the CancelEdit() method is invoked. The restore point is removed using Remove() after invoking CancelEdit() and EndEdit()

The implementation assumes that no other object being tracked by the same Recorder will be modified between calls to BeginEdit() and CancelEdit(), otherwise changes to these other objects will be canceled as well.

Constructors

Name Description
EditableObjectAttribute()
EditableObjectAttribute(PortableFormatterConstructorContext)

Explicit Interface Implementations

Name Description
IAspectProvider.ProvideAspects(Object)

Provides new aspects.