Hi.
I have a quite simple query. In our project we have the occasional need to "read" the content inside an annotation, sometimes just to know what it is and others to manipulate it (change it in some way). Well, the way we're currently doing it is like this:
document.Selection.Clear();
document.CaretPosition.MoveToInline(annotation);
document.CaretPosition.MoveToNext();
document.Selection.AddSelectionStart(document.CaretPosition);
document.CaretPosition.MoveToInline(annotation.End);
document.Selection.AddSelectionEnd(document.CaretPosition);
... where 'document' is the RadRichTextBox.Document and 'annotation' is an AnnotationRangeStart object. So, in essence, we are navigating the caret to select the content inside the annotation, and then we can directly read the document.Selection and obtain that content inside the annotation (and, when need it, completely replace the selection, for instance).
So, my question is: isn't there a more direct way to do this? It just seems to me like a lot of navigation, specially after we have previously searched for the annotation object... although it may just be the best way to do it, in which case this could serve somebody else :)
Cheers,
Juan
I have a quite simple query. In our project we have the occasional need to "read" the content inside an annotation, sometimes just to know what it is and others to manipulate it (change it in some way). Well, the way we're currently doing it is like this:
document.Selection.Clear();
document.CaretPosition.MoveToInline(annotation);
document.CaretPosition.MoveToNext();
document.Selection.AddSelectionStart(document.CaretPosition);
document.CaretPosition.MoveToInline(annotation.End);
document.Selection.AddSelectionEnd(document.CaretPosition);
... where 'document' is the RadRichTextBox.Document and 'annotation' is an AnnotationRangeStart object. So, in essence, we are navigating the caret to select the content inside the annotation, and then we can directly read the document.Selection and obtain that content inside the annotation (and, when need it, completely replace the selection, for instance).
So, my question is: isn't there a more direct way to do this? It just seems to me like a lot of navigation, specially after we have previously searched for the annotation object... although it may just be the best way to do it, in which case this could serve somebody else :)
Cheers,
Juan