Table of Contents

Class ModelSynchronization

Namespace
NMF.AnyText
Assembly
NMF.AnyText.Synchronizations.dll

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

SynchronizationDirection

IsAutomatic

True, if the synchronization should be performed automatically, otherwise false

public bool IsAutomatic { get; init; }

Property Value

bool

LeftExtension

Gets the file extension to identify files of the left models

public string LeftExtension { get; init; }

Property Value

string

Name

The unique identifier of the synchronization

public string Name { get; init; }

Property Value

string

OpposeDirection

True, if the synchronization direction is inverted if the right model is opened as second

public bool OpposeDirection { get; init; }

Property Value

bool

RightExtension

Gets the file extension to identify files of the right models

public string RightExtension { get; init; }

Property Value

string

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

uri Uri

the Uri to synchronize

synchronizedUri Uri

the 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

uri1 Uri

the first Uri to synchronize

root1 IModelElement

the root element of the first model

uri2 Uri

the second Uri to synchronize

root2 IModelElement

the root element of the second model

Returns

IRunningSynchronization

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

leftUri Uri

the URI of the left model

leftRoot IModelElement

the left root model

rightUri Uri

the URI of the right model

rightRoot IModelElement

the 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

leftUri Uri

the URI of the left model

leftRoot IModelElement

the left root model

rightUri Uri

the URI of the right model

rightRoot IModelElement

the right root model

Returns

IRunningSynchronization

A running synchronization or null, if the synchronization is aborted