public void RaiseNewContentEvent(IDocumentViewer documentViewer, DocumentViewerContent content, IContentType contentType) { if (documentViewer == null) { throw new ArgumentNullException(nameof(documentViewer)); } if (content == null) { throw new ArgumentNullException(nameof(content)); } if (contentType == null) { throw new ArgumentNullException(nameof(contentType)); } var e = new DocumentViewerGotNewContentEventArgs(documentViewer, content, contentType); NotifyListeners(e); GotNewContent?.Invoke(this, e); }
void DocumentViewer_GotNewContent(object?sender, DocumentViewerGotNewContentEventArgs e) { spanReferenceCollection = documentViewer?.Content.GetCustomData <SpanDataCollection <ReferenceAndId> >(DocumentViewerContentDataIds.SpanReference) ?? SpanDataCollection <ReferenceAndId> .Empty; currentReference = GetCurrentReference(); currentSpanReference = GetCurrentSpanReference(); }