/// <summary>Clears all highlight annotations from the current selection of the viewer control associated with the given <see cref="T:System.Windows.Annotations.AnnotationService" />.</summary> /// <param name="service">The annotation service from which to remove highlight annotations.</param> /// <exception cref="T:System.ArgumentNullException"> /// <paramref name="service" /> is <see langword="null" />.</exception> /// <exception cref="T:System.ArgumentException"> /// <paramref name="service" /> is not enabled.</exception> // Token: 0x060062BE RID: 25278 RVA: 0x001BB204 File Offset: 0x001B9404 public static void ClearHighlightsForSelection(AnnotationService service) { EventTrace.EasyTraceEvent(EventTrace.Keyword.KeywordAnnotation, EventTrace.Event.ClearHighlightBegin); try { AnnotationHelper.Highlight(service, null, null, false); } finally { EventTrace.EasyTraceEvent(EventTrace.Keyword.KeywordAnnotation, EventTrace.Event.ClearHighlightEnd); } }
/// <summary>Creates a highlight annotation on the current selection of the viewer control associated with the specified <see cref="T:System.Windows.Annotations.AnnotationService" />.</summary> /// <param name="service">The annotation service to use to create the highlight annotation.</param> /// <param name="author">The author of the annotation.</param> /// <param name="highlightBrush">The brush to use to draw the highlight over the selected content.</param> /// <returns>The highlight annotation; or <see langword="null" />, if there is no selected content to highlight.</returns> /// <exception cref="T:System.ArgumentNullException"> /// <paramref name="service" /> is <see langword="null" />.</exception> /// <exception cref="T:System.ArgumentException"> /// <paramref name="service" /> is not enabled. -or- /// <paramref name="highlightBrush" /> in not a <see cref="T:System.Windows.Media.SolidColorBrush" />.</exception> /// <exception cref="T:System.InvalidOperationException">The viewer control contains no content selection.</exception> // Token: 0x060062BB RID: 25275 RVA: 0x001BB194 File Offset: 0x001B9394 public static Annotation CreateHighlightForSelection(AnnotationService service, string author, Brush highlightBrush) { Annotation annotation = null; EventTrace.EasyTraceEvent(EventTrace.Keyword.KeywordAnnotation, EventTrace.Event.CreateHighlightBegin); try { annotation = AnnotationHelper.Highlight(service, author, highlightBrush, true); Invariant.Assert(annotation != null, "Highlight not returned from create call."); } finally { EventTrace.EasyTraceEvent(EventTrace.Keyword.KeywordAnnotation, EventTrace.Event.CreateHighlightEnd); } return(annotation); }