示例#1
0
 public void SetContent(DocumentViewerContent content, IContentType contentType)
 {
     if (isDisposed)
     {
         throw new ObjectDisposedException(nameof(IDocumentViewer));
     }
     if (content == null)
     {
         throw new ArgumentNullException(nameof(content));
     }
     if (documentViewerControl.SetContent(content, contentType))
     {
         outputData.Clear();
         var newContentType = documentViewerControl.TextView.TextBuffer.ContentType;
         GotNewContent?.Invoke(this, new DocumentViewerGotNewContentEventArgs(this, content, newContentType));
         documentViewerServiceImpl.RaiseNewContentEvent(this, content, newContentType);
     }
 }
示例#2
0
        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);
        }