Hi everybody,
how can I retrieve the documentposition of a certain Span (not the current where the caret is in). The background is: I need to move the caret to a specific Span when pushing the FastForward / FastRewind button of a microphone to easily dictat in a RadRichTextBox.
Here is what I have yet:
I hoped to find something that gives me the DocumentPosition where the "???" are.
Is this approach the right one?
Thanks in advance
Jo
how can I retrieve the documentposition of a certain Span (not the current where the caret is in). The background is: I need to move the caret to a specific Span when pushing the FastForward / FastRewind button of a microphone to easily dictat in a RadRichTextBox.
Here is what I have yet:
List<NamedPermissionRangeStart> allPermissionRangeStarts = Document.EnumerateChildrenOfType<NamedPermissionRangeStart>().SkipWhile(a => a.Type !=
"Text"
).ToList();
NamedPermissionRangeStart cur = (NamedPermissionRangeStart)Document.CaretPosition.GetCurrentSpanBox().AssociatedSpan.PreviousSibling;
for
(
int
i = 0; i < allPermissionRangeStarts.Count; i++)
{
if
(allPermissionRangeStarts[i].InternalKey == cur.InternalKey)
{
Document.CaretPosition.MoveToPosition(((Span)allPermissionRangeStarts[i + 1].NextSibling).?????)
break
;
}
}
I hoped to find something that gives me the DocumentPosition where the "???" are.
Is this approach the right one?
Thanks in advance
Jo