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
isInvertibleboolignored
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
elementIModelElementThe 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
elementIModelElementThe model element to attach to
serializableboolTrue, if the recoirder should support serialization, otherwise false
Detach(IModelElement)
Detaches from the given model element
public void Detach(IModelElement element)
Parameters
elementIModelElementThe element to detach from
Detach(IModelElement, bool)
Detaches from the given model element
public void Detach(IModelElement element, bool serializable)
Parameters
elementIModelElementThe element to detach from
serializableboolTrue, 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
serializableboolTrue, 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
elementIModelElement
Stop(bool)
Detaches the recorder, stopping the change tracking.
public void Stop(bool detachAll = true)
Parameters
detachAllbool