Class ModelChangeRecorder
Represents a recorder for changes to a model.
public class ModelChangeRecorder
- Inheritance
-
ModelChangeRecorder
- Inherited Members
Constructors
ModelChangeRecorder()
Creates a new instance
public ModelChangeRecorder()
ModelChangeRecorder(bool)
Creates a new instance
[Obsolete("isInvertible is actually ignored")]
public ModelChangeRecorder(bool isInvertible)
Parameters
isInvertible
boolignored
Properties
AttachedElement
Gets the attached model element or null, if the recorder is not attached.
[Obsolete("Use AttachedElements instead")]
public IModelElement AttachedElement { get; }
Property Value
AttachedElements
Gets the attached model elements
public IEnumerable<IModelElement> AttachedElements { get; }
Property Value
IsRecording
Checks whether the recorder is attached to a model element.
public bool IsRecording { get; }
Property Value
Methods
Attach(IModelElement)
Attaches the recorder to the given model element. The recorder will track all changes made to the given element and every element further down in the containment hierarchy.
public void Attach(IModelElement element)
Parameters
element
IModelElementThe model element to attach to
Attach(IModelElement, bool)
Attaches the recorder to the given model element. The recorder will track all changes made to the given element and every element further down in the containment hierarchy.
public void Attach(IModelElement element, bool serializable)
Parameters
element
IModelElementThe model element to attach to
serializable
boolTrue, if the recoirder should support serialization, otherwise false
Detach(IModelElement)
Detaches from the given model element
public void Detach(IModelElement element)
Parameters
element
IModelElementThe element to detach from
Detach(IModelElement, bool)
Detaches from the given model element
public void Detach(IModelElement element, bool serializable)
Parameters
element
IModelElementThe element to detach from
serializable
boolTrue, if the recoirder should support serialization, otherwise false
DetachAll()
Detaches from all attached model elements
public void DetachAll()
DetachAll(bool)
Detaches from all attached model elements
public void DetachAll(bool serializable)
Parameters
serializable
boolTrue, if the recoirder should support serialization, otherwise false
GetModelChanges()
Returns previously recorded changes in a tree hierarchy.
public ModelChangeSet GetModelChanges()
Returns
GetModelChangesAsync()
Returns previously recorded changes in a tree hierarchy.
public Task<ModelChangeSet> GetModelChangesAsync()
Returns
Reset()
Resets the model change recorder such that it can be started again
public void Reset()
Exceptions
- InvalidOperationException
Thrown if the recorder is already recording
Start()
Starts recording
public void Start()
Exceptions
- InvalidOperationException
Thrown if the recorder is already recording
Start(IModelElement)
Attaches the recorder to the given model element. The recorder will track all changes made to the given element and every element further down in the containment hierarchy.
public void Start(IModelElement element)
Parameters
element
IModelElement
Stop(bool)
Detaches the recorder, stopping the change tracking.
public void Stop(bool detachAll = true)
Parameters
detachAll
bool