// Token: 0x060062D7 RID: 25303 RVA: 0x001BBC34 File Offset: 0x001B9E34 private static void DeleteSpannedAnnotations(AnnotationService service, XmlQualifiedName annotationType) { AnnotationHelper.CheckInputs(service); Invariant.Assert(annotationType != null && (annotationType == HighlightComponent.TypeName || annotationType == StickyNoteControl.TextSchemaName || annotationType == StickyNoteControl.InkSchemaName), "Invalid Annotation Type"); ITextSelection textSelection = AnnotationHelper.GetTextSelection((FrameworkElement)service.Root); Invariant.Assert(textSelection != null, "TextSelection is null"); IList <IAttachedAnnotation> spannedAnnotations = AnnotationHelper.GetSpannedAnnotations(service); foreach (IAttachedAnnotation attachedAnnotation in spannedAnnotations) { if (annotationType.Equals(attachedAnnotation.Annotation.AnnotationType)) { TextAnchor textAnchor = attachedAnnotation.AttachedAnchor as TextAnchor; if (textAnchor != null && ((textSelection.Start.CompareTo(textAnchor.Start) > 0 && textSelection.Start.CompareTo(textAnchor.End) < 0) || (textSelection.End.CompareTo(textAnchor.Start) > 0 && textSelection.End.CompareTo(textAnchor.End) < 0) || (textSelection.Start.CompareTo(textAnchor.Start) <= 0 && textSelection.End.CompareTo(textAnchor.End) >= 0) || AnnotationHelper.CheckCaret(textSelection, textAnchor, annotationType))) { service.Store.DeleteAnnotation(attachedAnnotation.Annotation.Id); } } } }