public void Remove([NotNull] Annotation annotation) { if (_annotations?.Contains(annotation) ?? false) { _annotations.Remove(annotation); AnnotationRemoved?.Invoke(annotation); } }
public void Clear() { var annotations = Items?.ToArray(); if (annotations?.Any() ?? false) { foreach (var annotation in annotations) { AnnotationRemoved?.Invoke(annotation); } _annotations.Clear(); } }