Esempio n. 1
0
        private void ObjLibraryFilterControl_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.pdf_documents = pdf_documents;

            // Check if this library is empty
            int EMPTY_LIBRARY_THRESHOLD = 5;

            if (web_library_detail.Xlibrary.PDFDocuments.Count > EMPTY_LIBRARY_THRESHOLD)
            {
                ObjLibraryEmptyDescriptionBorder.Visibility = Visibility.Collapsed;
            }
            else
            {
                ObjLibraryEmptyDescriptionBorder.Visibility = Visibility.Visible;
            }

            // Check if we should hint about BibTex
            {
                int NUM_TO_CHECK         = 10;
                int total_without_bibtex = 0;
                List <PDFDocument> pdf_document_to_check_for_bibtex = web_library_detail.Xlibrary.PDFDocuments;
                for (int i = 0; i < pdf_document_to_check_for_bibtex.Count && i < NUM_TO_CHECK; ++i)
                {
                    if (!pdf_document_to_check_for_bibtex[i].Deleted && String.IsNullOrEmpty(pdf_document_to_check_for_bibtex[i].BibTex))
                    {
                        ++total_without_bibtex;
                    }
                }

                // Set the visibility - must have a few documents, and more than
                ObjNotMuchBibTeXDescriptionBorder.Visibility = Visibility.Collapsed;
                if (web_library_detail.Xlibrary.PDFDocuments.Count > EMPTY_LIBRARY_THRESHOLD && pdf_document_to_check_for_bibtex.Count > 0)
                {
                    if (total_without_bibtex / (double)pdf_document_to_check_for_bibtex.Count >= 0.5 || total_without_bibtex / (double)NUM_TO_CHECK >= 0.5)
                    {
                        ObjNotMuchBibTeXDescriptionBorder.Visibility = Visibility.Visible;
                    }
                }
            }
        }
 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)
 {
     SetPDFDocuments(pdf_documents, pdf_document_to_focus_on, filter_terms, search_scores);
 }