How do I save only some annotations?

14 views
Skip to first unread message

James

unread,
Jan 9, 2013, 5:26:54 PM1/9/13
to silv...@googlegroups.com
Q:

We’ve implemented our own text highlighting feature with the silverdox control by using the TextSearch class and drawing annotations around the hits.  We also need to provide the ability for users to draw their own custom annotations and save them.  When it comes time to save, is there a way to filter out the “highlight” annotations we’ve created so they’re not saved in the xml?

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

A:

This could be implemented a couple of different ways. One way would be to keep a separate list of the highlight annotations, and as part of the save process temporarily remove them, save the surviving annotations  and then re-add the highlights again (using AnnotationManager.RemoveAnnotation(annot) and .AddAnnotation(annot)). Another solution would be to "manually" parse the XML representation of the annotations, stripping out the highlight annotations before writing them to the storage device.
Reply all
Reply to author
Forward
0 new messages