Table of Contents

Class ModelChangeRecorder

Namespace
NMF.Models.Changes
Assembly
NMF.Models.dll

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 bool

ignored

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

IModelElement

AttachedElements

Gets the attached model elements

public IEnumerable<IModelElement> AttachedElements { get; }

Property Value

IEnumerable<IModelElement>

IsRecording

Checks whether the recorder is attached to a model element.

public bool IsRecording { get; }

Property Value

bool

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 IModelElement

The 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 IModelElement

The model element to attach to

serializable bool

True, if the recoirder should support serialization, otherwise false

Detach(IModelElement)

Detaches from the given model element

public void Detach(IModelElement element)

Parameters

element IModelElement

The element to detach from

Detach(IModelElement, bool)

Detaches from the given model element

public void Detach(IModelElement element, bool serializable)

Parameters

element IModelElement

The element to detach from

serializable bool

True, 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 bool

True, if the recoirder should support serialization, otherwise false

GetModelChanges()

Returns previously recorded changes in a tree hierarchy.

public ModelChangeSet GetModelChanges()

Returns

ModelChangeSet

GetModelChangesAsync()

Returns previously recorded changes in a tree hierarchy.

public Task<ModelChangeSet> GetModelChangesAsync()

Returns

Task<ModelChangeSet>

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