示例#1
0
        internal void OnFilterChanged(LibraryFilterControl library_filter_control, List <PDFDocument> pdf_documents, Span descriptive_span, string filter_terms, Dictionary <string, double> search_scores, PDFDocument pdf_document_to_focus_on)
        {
            this.library_filter_control = library_filter_control;

            if (null != descriptive_span)
            {
                int match_count = 0;
                foreach (var pdf_document in pdf_documents)
                {
                    if (!pdf_document.Deleted)
                    {
                        ++match_count;
                    }
                }

                ObjLibraryFilterDescriptiveTextBorder.Visibility = Visibility.Visible;

                Paragraph paragraph = new Paragraph();
                paragraph.Inlines.Add(LibraryFilterHelpers.GetClearImageInline("Clear all filters.", hyperlink_clear_all_OnClick));
                paragraph.Inlines.Add(" ");
                paragraph.Inlines.Add("Library currently filtered by: ");
                paragraph.Inlines.Add(descriptive_span);
                paragraph.Inlines.Add("(" + match_count + " matching documents)");


                // Add to our viewer
                ObjLibraryFilterDescriptiveText.Blocks.Clear();
                ObjLibraryFilterDescriptiveText.Blocks.Add(paragraph);
            }
            else
            {
                ObjLibraryFilterDescriptiveTextBorder.Visibility = Visibility.Collapsed;
                ObjLibraryFilterDescriptiveText.Blocks.Clear();
            }
        }
示例#2
0
        public static void Test()
        {
            LibraryFilterControl l      = new LibraryFilterControl();
            ControlHostingWindow window = new ControlHostingWindow("Library index", l);

            window.Show();
        }