Class ModelSynchronization
Represents the abstract base class for model synchronization logic of two models with a role separation of left and right.
public abstract class ModelSynchronization : IModelSynchronization
- Inheritance
-
ModelSynchronization
- Implements
- Derived
- Inherited Members
Properties
Direction
Gets the synchronization direction
public SynchronizationDirection Direction { get; init; }
Property Value
IsAutomatic
True, if the synchronization should be performed automatically, otherwise false
public bool IsAutomatic { get; init; }
Property Value
LeftExtension
Gets the file extension to identify files of the left models
public string LeftExtension { get; init; }
Property Value
Name
The unique identifier of the synchronization
public string Name { get; init; }
Property Value
OpposeDirection
True, if the synchronization direction is inverted if the right model is opened as second
public bool OpposeDirection { get; init; }
Property Value
RightExtension
Gets the file extension to identify files of the right models
public string RightExtension { get; init; }
Property Value
Methods
CanSynchronize(Uri, out Uri)
Determines whether a document of the given Uri can be synchronized
public bool CanSynchronize(Uri uri, out Uri synchronizedUri)
Parameters
uriUrithe Uri to synchronize
synchronizedUriUrithe Uri that the given document can be synchronized with
Returns
- bool
true, if the document can be synchronized, otherwise false
GetRightToLeftDirection()
Gets the direction for right to left synchronizations
protected SynchronizationDirection GetRightToLeftDirection()
Returns
- SynchronizationDirection
the synchronization direction for reverse synchronizations
Synchronize(Uri, ref IModelElement, Uri, ref IModelElement)
Starts synchronizing the given Uri
public IRunningSynchronization Synchronize(Uri uri1, ref IModelElement root1, Uri uri2, ref IModelElement root2)
Parameters
uri1Urithe first Uri to synchronize
root1IModelElementthe root element of the first model
uri2Urithe second Uri to synchronize
root2IModelElementthe root element of the second model
Returns
SynchronizeLeftToRight(Uri, ref IModelElement, Uri, ref IModelElement)
Starts the synchronization from the left model to the right model
protected abstract IRunningSynchronization SynchronizeLeftToRight(Uri leftUri, ref IModelElement leftRoot, Uri rightUri, ref IModelElement rightRoot)
Parameters
leftUriUrithe URI of the left model
leftRootIModelElementthe left root model
rightUriUrithe URI of the right model
rightRootIModelElementthe right root model
Returns
- IRunningSynchronization
A running synchronization or null, if the synchronization is aborted
SynchronizeRightToLeft(Uri, ref IModelElement, Uri, ref IModelElement)
Starts the synchronization from the right model to the left model
protected abstract IRunningSynchronization SynchronizeRightToLeft(Uri leftUri, ref IModelElement leftRoot, Uri rightUri, ref IModelElement rightRoot)
Parameters
leftUriUrithe URI of the left model
leftRootIModelElementthe left root model
rightUriUrithe URI of the right model
rightRootIModelElementthe right root model
Returns
- IRunningSynchronization
A running synchronization or null, if the synchronization is aborted