Back to Devexpress

TrackedMovesConflictEventArgs.ResolveMode Property

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

latest6.2 KB
Original Source

TrackedMovesConflictEventArgs.ResolveMode Property

Gets or sets what version of moved text to keep.

Namespace : DevExpress.XtraRichEdit

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
public TrackedMovesConflictResolveMode ResolveMode { get; set; }
vb
Public Property ResolveMode As TrackedMovesConflictResolveMode

Property Value

TypeDescription
TrackedMovesConflictResolveMode

One of the TrackedMovesConflictResolveMode enumeration values indication the resolve mode.

|

Available values:

NameDescription
KeepOriginalLocationText

Keep text from the original location.

| | KeepNewLocationText |

Keep text from the new location.

|

Remarks

Use the ResolveMode property to specify the version of moved text you want to keep.

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

The following code snippets (auto-collected from DevExpress Examples) contain references to the ResolveMode property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

word-document-api-use-track-changes/CS/Program.cs#L66

csharp
//Keep text from the location whose range is the smallest
    e.ResolveMode = (e.OriginalLocationRange.Length <= e.NewLocationRange.Length) ? TrackedMovesConflictResolveMode.KeepOriginalLocationText : TrackedMovesConflictResolveMode.KeepNewLocationText;
}

winforms-rich-edit-manage-tracked-changes/CS/XtraRichEdit_TrackChanges/Form1.cs#L88

csharp
//Keep text from the location whose range is the smallest
    e.ResolveMode = (e.OriginalLocationRange.Length <= e.NewLocationRange.Length) ? TrackedMovesConflictResolveMode.KeepOriginalLocationText : TrackedMovesConflictResolveMode.KeepNewLocationText;
}

wpf-richedit-manage-tracked-changes/CS/DXRichEdit_TrackChanges/MainWindow.xaml.cs#L49

csharp
//Keep text from the location whose range is the smallest
    e.ResolveMode = (e.OriginalLocationRange.Length <= e.NewLocationRange.Length) ? TrackedMovesConflictResolveMode.KeepOriginalLocationText : TrackedMovesConflictResolveMode.KeepNewLocationText;
}

word-document-api-use-track-changes/VB/Program.vb#L60

vb
'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

winforms-rich-edit-manage-tracked-changes/VB/XtraRichEdit_TrackChanges/Form1.vb#L71

vb
'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

wpf-richedit-manage-tracked-changes/VB/DXRichEdit_TrackChanges/MainWindow.xaml.vb#L41

vb
'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