internal void ShowTagOptions(WebLibraryDetail library_, List <PDFDocument> pdf_documents_, OnShowTagOptionsCompleteDelegate OnShowTagOptionsComplete_) { web_library_detail = library_; pdf_documents = pdf_documents_; OnShowTagOptionsComplete = OnShowTagOptionsComplete_; // Collate all the available tags HashSet <string> all_tags = new HashSet <string>(); HashSet <string> all_creators = new HashSet <string>(); foreach (var pdf_document in pdf_documents) { if (pdf_document.Deleted) { continue; } foreach (var pdf_annotation in pdf_document.GetAnnotations()) { if (pdf_annotation.Deleted) { continue; } if (null != pdf_annotation.Creator) { all_creators.Add(pdf_annotation.Creator); } string tags_bundle = pdf_annotation.Tags; HashSet <string> local_tags = TagTools.ConvertTagBundleToTags(tags_bundle); foreach (var tag in local_tags) { all_tags.Add(tag); } } } List <string> all_creators_sorted = new List <string>(all_creators); all_creators_sorted.Sort(); ObservableCollection <string> all_creators_source = new ObservableCollection <string>(all_creators_sorted); ObjFilterByCreatorCombo.ItemsSource = all_creators_source; all_tags.Add(HighlightToAnnotationGenerator.HIGHLIGHTS_TAG); all_tags.Add(InkToAnnotationGenerator.INKS_TAG); List <string> all_tags_sorted = new List <string>(all_tags); all_tags_sorted.Sort(); ObservableCollection <string> bindable_tags = new ObservableCollection <string>(all_tags_sorted); ListTags.Items.Clear(); ListTags.ItemsSource = bindable_tags; Show(); }
internal void ShowTagOptions(Library library, List <PDFDocument> pdf_documents, OnShowTagOptionsCompleteDelegate OnShowTagOptionsComplete) { this.library = library; this.pdf_documents = pdf_documents; this.OnShowTagOptionsComplete = OnShowTagOptionsComplete; // Collate all the availalbe tags HashSet <string> all_tags = new HashSet <string>(); HashSet <string> all_creators = new HashSet <string>(); foreach (var pdf_document in pdf_documents) { if (pdf_document.Deleted) { continue; } foreach (var pdf_annotation in pdf_document.Annotations) { if (pdf_annotation.Deleted) { continue; } if (null != pdf_annotation.Creator) { all_creators.Add(pdf_annotation.Creator); } string tags_bundle = pdf_annotation.Tags; HashSet <string> local_tags = TagTools.ConvertTagBundleToTags(tags_bundle); foreach (var tag in local_tags) { all_tags.Add(tag); } } } List <string> all_creators_sorted = new List <string>(all_creators); all_creators_sorted.Sort(); ObjFilterByCreatorCombo.ItemsSource = all_creators_sorted; List <string> bindable_tags = new List <string>(all_tags); bindable_tags.Add(HighlightToAnnotationGenerator.HIGHLIGHTS_TAG); bindable_tags.Add(InkToAnnotationGenerator.INKS_TAG); bindable_tags.Sort(); ListTags.Items.Clear(); ListTags.ItemsSource = bindable_tags; this.Show(); }