internal PDFHightlightList GetHighlights(Dictionary <string, byte[]> library_items_highlights_cache) { if (null == highlights) { highlights = new PDFHightlightList(); PDFHighlightSerializer.ReadFromStream(this, highlights, library_items_highlights_cache); highlights.OnPDFHighlightListChanged += highlights_OnPDFHighlightListChanged; } return(highlights); }
/// <summary> /// Deep clone, but does not copy the OnPDFHighlightListChanged subscribers. /// </summary> public object Clone() { var clone = new PDFHightlightList(); foreach (var highlights_for_page in highlights.Values) { foreach (var highlight in highlights_for_page) { clone.__AddUpdatedHighlight((PDFHighlight)highlight.Clone()); } } return(clone); }
/// <summary> /// NB: only call this as part of document creation. /// </summary> public void CloneMetaData(PDFDocument existing_pdf_document) { bindable = null; Logging.Info("Cloning metadata from {0}", existing_pdf_document.Title); dictionary = (DictionaryBasedObject)existing_pdf_document.dictionary.Clone(); annotations = (PDFAnnotationList)existing_pdf_document.Annotations.Clone(); highlights = (PDFHightlightList)existing_pdf_document.Highlights.Clone(); inks = (PDFInkList)existing_pdf_document.Inks.Clone(); SaveToMetaData(); // Copy the citations PDFDocumentCitationManager.CloneFrom(existing_pdf_document.PDFDocumentCitationManager); // Now clear out the references for the annotations and highlights, so that when they are reloaded the events are resubscribed annotations = null; highlights = null; inks = null; }