Back to Devexpress

TrackedMovesConflictEventArgs.OriginalLocationRange Property

officefileapi-devexpress-dot-xtrarichedit-dot-trackedmovesconflicteventargs-31135f74.md

latest2.6 KB
Original Source

TrackedMovesConflictEventArgs.OriginalLocationRange Property

Retrieves the range of the moved text’s original location.

Namespace : DevExpress.XtraRichEdit

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
public DocumentRange OriginalLocationRange { get; }
vb
Public ReadOnly Property OriginalLocationRange As DocumentRange

Property Value

TypeDescription
DocumentRange

A DocumentRange object that is original location’s range.

|

Remarks

The TrackedMovesConflictEventArgs.NewLocationRange property provides access to the range of the moved text’s new location.

The code sample below shows how to handle the TrackedMovesConflict event to keep original text:

csharp
private void WordProcessor_TrackedMovesConflict(object sender, TrackedMovesConflictEventArgs e)
{
  //Compare the length of the original and new location ranges
  //Keep text from the location whose range is the smallest
  e.ResolveMode = (e.OriginalLocationRange.Length <= e.NewLocationRange.Length) ? TrackedMovesConflictResolveMode.KeepOriginalLocationText : TrackedMovesConflictResolveMode.KeepNewLocationText;
}
vb
Private Sub WordProcessor_TrackedMovesConflict(ByVal sender As Object, ByVal e As TrackedMovesConflictEventArgs)
    'Compare the length of the original and new location ranges
    'Keep text from the location whose range is the smallest
    e.ResolveMode = If((e.OriginalLocationRange.Length <= e.NewLocationRange.Length), TrackedMovesConflictResolveMode.KeepOriginalLocationText, TrackedMovesConflictResolveMode.KeepNewLocationText)
End Sub

See Also

TrackedMovesConflictEventArgs Class

TrackedMovesConflictEventArgs Members

DevExpress.XtraRichEdit Namespace