public PDFReadingControl(PDFDocument pdf_document)
        {
            InitializeComponent();

            pdf_renderer_control = new PDFRendererControl(pdf_document, true);
            pdf_renderer_control.OperationModeChanged += pdf_renderer_control_OperationModeChanged;
            pdf_renderer_control.ZoomTypeChanged      += pdf_renderer_control_ZoomTypeChanged;
            pdf_renderer_control.SelectedPageChanged  += pdf_renderer_control_SelectedPageChanged;

            pdf_renderer_control_stats = new PDFRendererControlStats(pdf_renderer_control, pdf_document);

            Utilities.GUI.Animation.Animations.EnableHoverFade(ObjToolbarGrid);

            // Add the renderer control to our grid
            PDFRendererControlArea.Children.Add(pdf_renderer_control);

            HighlightCanvasToolbar.PDFRendererControl = pdf_renderer_control;
            InkCanvasToolbar.PDFRendererControl       = pdf_renderer_control;
            TextCanvasToolbar.PDFRendererControl      = pdf_renderer_control;

            KeyUp += PDFReadingControl_KeyUp;

            ButtonHand.Icon    = Icons.GetAppIcon(Icons.Hand);
            ButtonHand.ToolTip = LocalisationManager.Get("PDF/TIP/MOVE_PAGE");
            ButtonHand.Click  += ButtonHand_Click;

            ButtonTextSentenceSelect.Icon    = Icons.GetAppIcon(Icons.TextSentenceSelect);
            ButtonTextSentenceSelect.ToolTip = LocalisationManager.Get("PDF/TIP/SELECT_TEXT");
            ButtonTextSentenceSelect.Click  += ButtonTextSentenceSelect_Click;

            ButtonAnnotation.Icon    = Icons.GetAppIcon(Icons.Annotation);
            ButtonAnnotation.ToolTip = LocalisationManager.Get("PDF/TIP/ADD_ANNOTATION");
            ButtonAnnotation.Click  += ButtonAnnotation_Click;

            ButtonHighlighter.Icon    = Icons.GetAppIcon(Icons.Highlighter);
            ButtonHighlighter.ToolTip = LocalisationManager.Get("PDF/TIP/ADD_HIGHLIGHT");
            ButtonHighlighter.Click  += ButtonHighlighter_Click;

            ButtonCamera.Icon    = Icons.GetAppIcon(Icons.Camera);
            ButtonCamera.ToolTip = LocalisationManager.Get("PDF/TIP/SNAPSHOT");
            ButtonCamera.Click  += ButtonCamera_Click;

            ButtonInk.Icon    = Icons.GetAppIcon(Icons.Ink);
            ButtonInk.ToolTip = LocalisationManager.Get("PDF/TIP/ADD_INK");
            ButtonInk.Click  += ButtonInk_Click;

            ButtonExplore.Visibility = ConfigurationManager.Instance.NoviceVisibility;
            ButtonExplore.AttachPopup(ButtonExplorePopup);
            ButtonExplore.Icon    = Icons.GetAppIcon(Icons.Explore);
            ButtonExplore.ToolTip = LocalisationManager.Get("PDF/TIP/EXPLORE");

            ButtonExpedition.Icon    = Icons.GetAppIcon(Icons.ModuleExpedition);
            ButtonExpedition.Caption = LocalisationManager.Get("PDF/TIP/EXPEDITION");
            ButtonExpedition.Click  += ButtonExpedition_Click;

            ButtonExploreInBrainstorm.Icon    = Icons.GetAppIcon(Icons.ModuleBrainstorm);
            ButtonExploreInBrainstorm.Caption = LocalisationManager.Get("PDF/TIP/BRAINSTORM");
            ButtonExploreInBrainstorm.Click  += ButtonExploreInBrainstorm_Click;

            ButtonInCite.AttachPopup(ButtonInCitePopup);
            ButtonInCite.Icon    = Icons.GetAppIcon(Icons.ModuleInCite);
            ButtonInCite.ToolTip = LocalisationManager.Get("PDF/TIP/INCITE");

            ButtonInCite_Word.Icon    = Icons.GetAppIcon(Icons.InCiteNewCitation);
            ButtonInCite_Word.Caption = LocalisationManager.Get("PDF/CAP/CITE_WORD");
            ButtonInCite_Word.Click  += ButtonInCite_Word_Click;

            ButtonInCite_WordSeparate.Icon    = Icons.GetAppIcon(Icons.InCiteNewCitation);
            ButtonInCite_WordSeparate.Caption = LocalisationManager.Get("PDF/CAP/CITE_WORD_SEPARATE");
            ButtonInCite_WordSeparate.Click  += ButtonInCite_WordSeparate_Click;

            ButtonInCite_Snippet.Icon    = Icons.GetAppIcon(Icons.InCiteCitationSnippet);
            ButtonInCite_Snippet.Caption = LocalisationManager.Get("PDF/CAP/CITE_SNIPPET");
            ButtonInCite_Snippet.Click  += ButtonInCite_Snippet_Click;

            ButtonInCite_BibTeXKey.Icon    = Icons.GetAppIcon(Icons.ExportBibTex);
            ButtonInCite_BibTeXKey.Caption = LocalisationManager.Get("PDF/CAP/CITE_BIBTEX");
            ButtonInCite_BibTeXKey.Click  += ButtonInCite_BibTeXKey_Click;

            ButtonFullScreen.Icon    = Icons.GetAppIcon(Icons.DocumentFullScreen);
            ButtonFullScreen.ToolTip = LocalisationManager.Get("PDF/TIP/FULL_SCREEN");
            ButtonFullScreen.Click  += ButtonFullScreen_Click;

            ButtonZoom.AttachPopup(ButtonZoomPopup);
            ButtonZoom.Icon    = Icons.GetAppIcon(Icons.ZoomIn);
            ButtonZoom.ToolTip = LocalisationManager.Get("PDF/TIP/ZOOM");

            Button1Up.Icon    = Icons.GetAppIcon(Icons.Page1Up);
            Button1Up.Caption = LocalisationManager.Get("PDF/TIP/ZOOM_1");
            Button1Up.Click  += Button1Up_Click;

            Button2Up.Icon    = Icons.GetAppIcon(Icons.Page2Up);
            Button2Up.Caption = LocalisationManager.Get("PDF/TIP/ZOOM_2");
            Button2Up.Click  += Button2Up_Click;

            ButtonNUp.Icon    = Icons.GetAppIcon(Icons.PageNUp);
            ButtonNUp.Caption = LocalisationManager.Get("PDF/TIP/ZOOM_N");
            ButtonNUp.Click  += ButtonNUp_Click;

            ButtonWholeUp.Icon    = Icons.GetAppIcon(Icons.PageWholeUp);
            ButtonWholeUp.Caption = LocalisationManager.Get("PDF/TIP/ZOOM_WHOLE");
            ButtonWholeUp.Click  += ButtonWholeUp_Click;

            ButtonRotate.Icon    = Icons.GetAppIcon(Icons.PageRotate);
            ButtonRotate.Caption = LocalisationManager.Get("PDF/TIP/ROTATE");
            ButtonRotate.Click  += ButtonRotate_Click;

            ButtonRotateAll.Icon    = Icons.GetAppIcon(Icons.PageRotate);
            ButtonRotateAll.Caption = LocalisationManager.Get("PDF/TIP/ROTATE_ALL");
            ButtonRotateAll.Click  += ButtonRotateAll_Click;

            ButtonZoomIn.Icon    = Icons.GetAppIcon(Icons.ZoomIn);
            ButtonZoomIn.Caption = LocalisationManager.Get("PDF/TIP/ZOOM_IN");
            ButtonZoomIn.Click  += ButtonZoomIn_Click;

            ButtonZoomOut.Icon    = Icons.GetAppIcon(Icons.ZoomOut);
            ButtonZoomOut.Caption = LocalisationManager.Get("PDF/TIP/ZOOM_OUT");
            ButtonZoomOut.Click  += ButtonZoomOut_Click;

            ButtonMisc.Visibility = ConfigurationManager.Instance.NoviceVisibility;
            ButtonMisc.AttachPopup(ButtonMiscPopup);
            ButtonMisc.Icon    = Icons.GetAppIcon(Icons.DocumentMisc);
            ButtonMisc.ToolTip = LocalisationManager.Get("PDF/TIP/MISC");

            ButtonDocumentSave.Icon    = Icons.GetAppIcon(Icons.DocumentSave);
            ButtonDocumentSave.Caption = LocalisationManager.Get("PDF/TIP/SAVE_COPY");
            ButtonDocumentSave.Click  += ButtonDocumentSave_Click;

            ButtonPrint.Icon    = Icons.GetAppIcon(Icons.Printer);
            ButtonPrint.Caption = LocalisationManager.Get("PDF/TIP/PRINT");
            ButtonPrint.Click  += ButtonPrint_Click;

            ButtonOpenLibrary.Icon    = Icons.GetAppIcon(Icons.ModuleDocumentLibrary);
            ButtonOpenLibrary.Caption = LocalisationManager.Get("PDF/TIP/OPEN_PARENT_LIBRARY");
            ButtonOpenLibrary.Click  += ButtonOpenLibrary_Click;

            ButtonExportToText.Icon    = Icons.GetAppIcon(Icons.ExportToText);
            ButtonExportToText.Caption = LocalisationManager.Get("PDF/TIP/CONVERT_TO_TEXT");
            ButtonExportToText.Click  += ButtonExportToText_Click;

            ButtonReadOutLoud.Icon    = Icons.GetAppIcon(Icons.ReadOutLoud);
            ButtonReadOutLoud.Caption = LocalisationManager.Get("PDF/TIP/READ_ALOUD");
            ButtonReadOutLoud.Click  += ButtonReadOutLoud_Click;

            ButtonSpeedRead.Icon    = Icons.GetAppIcon(Icons.SpeedRead);
            ButtonSpeedRead.Caption = LocalisationManager.Get("PDF/TIP/SPEED_READ");
            ButtonSpeedRead.Click  += ButtonSpeedRead_Click;

            ButtonInvertColours.Icon      = Icons.GetAppIcon(Icons.DocumentsInvertColours);
            ButtonInvertColours.Caption   = LocalisationManager.Get("PDF/TIP/NEGATIVE");
            ButtonInvertColours.IsChecked = false;
            ButtonInvertColours.Click    += ButtonInvertColours_Click;

            ButtonMoreMenus.Icon    = Icons.GetAppIcon(Icons.DocumentMisc);
            ButtonMoreMenus.Caption = LocalisationManager.Get("PDF/TIP/MORE_MENUS");
            ButtonMoreMenus.Click  += ButtonMoreMenus_Click;

            ButtonJumpToSection.Icon    = Icons.GetAppIcon(Icons.JumpToSection);
            ButtonJumpToSection.ToolTip = LocalisationManager.Get("PDF/TIP/BOOKMARKS");
            ButtonJumpToSection.Click  += ButtonJumpToSection_Click;

            ButtonPreviousPage.Icon    = Icons.GetAppIcon(Icons.Previous);
            ButtonPreviousPage.ToolTip = LocalisationManager.Get("PDF/TIP/PAGE_PREV");
            ButtonPreviousPage.Click  += ButtonPreviousPage_Click;

            ButtonNextPage.Icon    = Icons.GetAppIcon(Icons.Next);
            ButtonNextPage.ToolTip = LocalisationManager.Get("PDF/TIP/PAGE_NEXT");
            ButtonNextPage.Click  += ButtonNextPage_Click;

            TextBoxFind.ToolTip       = LocalisationManager.Get("PDF/TIP/SEARCH");
            TextBoxFind.OnHardSearch += TextBoxFind_OnHardSearch;

            Webcasts.FormatWebcastButton(ButtonWebcast, Webcasts.PDF_VIEWER);

            // Make some space
            ToolBar.SetOverflowMode(ButtonPrint, OverflowMode.Always);
            ToolBar.SetOverflowMode(ButtonInvertColours, OverflowMode.Always);
            ToolBar.SetOverflowMode(ButtonCamera, OverflowMode.Always);
            ToolBar.SetOverflowMode(ButtonDocumentSave, OverflowMode.Always);
            ToolBar.SetOverflowMode(ButtonExportToText, OverflowMode.Always);
            ToolBar.SetOverflowMode(ButtonReadOutLoud, OverflowMode.Always);
            ToolBar.SetOverflowMode(ButtonMoreMenus, OverflowMode.Always);

            // Wizard
            WizardDPs.SetPointOfInterest(ButtonAnnotation, "PDFReadingAnnotationButton");

            ListSearchDetails.SearchSelectionChanged += ListSearchDetails_SearchSelectionChanged;
            ListSearchDetails.SearchClicked          += ListSearchDetails_SearchSelectionChanged;

            TagCloud.TagClick += TagCloud_TagClick;

            JumpToPageNumber.Text      = "" + 1;
            JumpToPageNumberMax.Text   = " of " + pdf_renderer_control_stats.pdf_document.PDFRenderer.PageCount;
            JumpToPageNumber.KeyDown  += JumpToPageNumber_KeyDown;
            JumpToPageNumber.KeyUp    += JumpToPageNumber_KeyUp;
            JumpToPageNumber.GotFocus += JumpToPageNumber_GotFocus;
            string tooltip = LocalisationManager.Get("PDF/TIP/PAGE_JUMP");

            JumpToPageNumberLabel.ToolTip = tooltip;
            JumpToPageNumber.ToolTip      = tooltip;

            // The search results are initially hidden
            GridBOTTOM.Visibility = Visibility.Collapsed;

            // Start in hand mode
            pdf_renderer_control.ReconsiderOperationMode(PDFRendererControl.OperationMode.Hand);

            ObjHyperlinkGuestPreviewMoveOther.Click     += ObjHyperlinkGuestPreviewMoveOther_Click;
            ObjHyperlinkGuestPreviewMoveDefault.Click   += ObjHyperlinkGuestPreviewMoveDefault_Click;
            ObjHyperlinkGuestPreviewVanillaAttach.Click += ObjHyperlinkGuestPreviewVanillaAttach_Click;

            ObjReadOnlyInfoBar.Visibility = pdf_document.Library.WebLibraryDetail.IsReadOnly ? Visibility.Visible : Visibility.Collapsed;

            DataContext = pdf_document.Bindable;

            ObjDocumentMetadataControlsPanel.SelectedPageChanged += ObjDocumentMetadataControlsPanel_ObjDocumentMetadataControlsPanel_SelectedPageChanged;

            // Kick off a thread that populates the interesting analysis
            SafeThreadPool.QueueUserWorkItem(o => PDFRendererControlInterestingAnalysis.DoInterestingAnalysis(this, pdf_renderer_control, pdf_renderer_control_stats));

            Loaded += PDFReadingControl_Loaded;
        }
Esempio n. 2
0
        public LibraryControl(WebLibraryDetail web_library_detail)
        {
            Theme.Initialize();

            Logging.Debug("+LibraryControl()");

            this.web_library_detail          = web_library_detail;
            dual_tab_drag_to_library_manager = new DragToLibraryManager(web_library_detail);

            InitializeComponent();

            ImageLibraryEmptyAddFiles.Source = Icons.GetAppIcon(Icons.LibraryEmptyAddFiles);
            RenderOptions.SetBitmapScalingMode(ImageLibraryEmptyAddFiles, BitmapScalingMode.HighQuality);
            ImageLibraryMissingBibTeX.Source = Icons.GetAppIcon(Icons.BibTexSniffer);
            RenderOptions.SetBitmapScalingMode(ImageLibraryMissingBibTeX, BitmapScalingMode.HighQuality);

            bool ADVANCED_MENUS = ConfigurationManager.Instance.ConfigurationRecord.GUI_AdvancedMenus;

            // Connect the dropdowns
            ButtonAddPDF.AttachPopup(ButtonAddPDFPopup);
            ButtonAddPDF.Icon = Icons.GetAppIcon(Icons.DocumentsAddToLibrary);
            if (!ADVANCED_MENUS)
            {
                ButtonAddPDF.Caption = LocalisationManager.Get("LIBRARY/CAP/POPUP_ADD_DOCUMENTS");
            }
            ButtonAddPDF.ToolTip = LocalisationManager.Get("LIBRARY/TIP/POPUP_ADD_DOCUMENTS");

            ButtonSync.AttachPopup(ButtonSyncPopup);
            ButtonSync.Icon = Icons.GetAppIcon(Icons.SyncWithCloud);
            if (!ADVANCED_MENUS)
            {
                ButtonSync.Caption = LocalisationManager.Get("LIBRARY/CAP/POPUP_SYNC");
            }
            ButtonSync.ToolTip = LocalisationManager.Get("LIBRARY/TIP/POPUP_SYNC");

            // Then the menus
            ButtonAddVanillaReference.Icon    = Icons.GetAppIcon(Icons.New);
            ButtonAddVanillaReference.Caption = LocalisationManager.Get("LIBRARY/CAP/ADD_REFERENCE");
            ButtonAddVanillaReference.ToolTip = LocalisationManager.Get("LIBRARY/TIP/ADD_REFERENCE");
            ButtonAddVanillaReference.Click  += ButtonAddVanillaReference_Click;

            ButtonSyncMetadaWithCloud.Icon    = Icons.GetAppIcon(Icons.SyncWithCloud);
            ButtonSyncMetadaWithCloud.Caption = LocalisationManager.Get("LIBRARY/CAP/PARTIAL_SYNC");
            ButtonSyncMetadaWithCloud.ToolTip = LocalisationManager.Get("LIBRARY/TIP/PARTIAL_SYNC");
            ButtonSyncMetadaWithCloud.Click  += ButtonSyncMetadaWithCloud_Click;

            ButtonSyncAllPDFsWithCloud.Icon    = Icons.GetAppIcon(Icons.SyncPDFsWithCloud);
            ButtonSyncAllPDFsWithCloud.Caption = LocalisationManager.Get("LIBRARY/CAP/FULL_SYNC");
            ButtonSyncAllPDFsWithCloud.ToolTip = LocalisationManager.Get("LIBRARY/TIP/FULL_SYNC");
            ButtonSyncAllPDFsWithCloud.Click  += ButtonSyncPDFsWithCloud_Click;

            ButtonSyncDetails.Icon    = Icons.GetAppIcon(Icons.SyncDetails);
            ButtonSyncDetails.Caption = LocalisationManager.Get("LIBRARY/CAP/SYNC_DETAILS");
            ButtonSyncDetails.ToolTip = LocalisationManager.Get("LIBRARY/TIP/SYNC_DETAILS");
            ButtonSyncDetails.Click  += ButtonSyncDetails_Click;

            ButtonEdit.Icon    = Icons.GetAppIcon(Icons.Open);
            ButtonEdit.Caption = LocalisationManager.Get("LIBRARY/CAP/EDIT");
            ButtonEdit.ToolTip = LocalisationManager.Get("LIBRARY/TIP/EDIT");
            ButtonEdit.Click  += ButtonEdit_Click;

            ButtonDelete.Icon    = Icons.GetAppIcon(Icons.Open);
            ButtonDelete.Caption = LocalisationManager.Get("LIBRARY/CAP/DELETE");
            ButtonDelete.ToolTip = LocalisationManager.Get("LIBRARY/TIP/DELETE");
            ButtonDelete.Click  += ButtonDelete_Click;

            ButtonAnnotationsReport.Icon = Icons.GetAppIcon(Icons.LibraryAnnotationsReport);
            if (!ADVANCED_MENUS)
            {
                ButtonAnnotationsReport.Caption = LocalisationManager.Get("LIBRARY/CAP/ANNOTATION_REPORT");
            }
            ButtonAnnotationsReport.ToolTip = LocalisationManager.Get("LIBRARY/TIP/ANNOTATION_REPORT");
            ButtonAnnotationsReport.Click  += ButtonAnnotationsReport_Click;
            WizardDPs.SetPointOfInterest(ButtonAnnotationsReport, "LibraryAnnotationReportButton");

            ButtonGenerateReferences.Visibility = ConfigurationManager.Instance.NoviceVisibility;
            ButtonGenerateReferences.Icon       = Icons.GetAppIcon(Icons.LibraryGenerateReferences);
            if (!ADVANCED_MENUS)
            {
                ButtonGenerateReferences.Caption = LocalisationManager.Get("LIBRARY/CAP/FIND_REFERENCES");
            }
            ButtonGenerateReferences.ToolTip = LocalisationManager.Get("LIBRARY/TIP/FIND_REFERENCES");
            ButtonGenerateReferences.Click  += ButtonGenerateReferences_Click;

            ButtonFindDuplicates.Visibility = ConfigurationManager.Instance.NoviceVisibility;
            ButtonFindDuplicates.Icon       = Icons.GetAppIcon(Icons.LibraryFindDuplicates);
            if (!ADVANCED_MENUS)
            {
                ButtonFindDuplicates.Caption = LocalisationManager.Get("LIBRARY/CAP/FIND_DUPLICATES");
            }
            ButtonFindDuplicates.ToolTip = LocalisationManager.Get("LIBRARY/TIP/FIND_DUPLICATES");
            ButtonFindDuplicates.Click  += ButtonFindDuplicates_Click;

            ButtonBibTexSniffer.Icon = Icons.GetAppIcon(Icons.BibTexSniffer);
            if (!ADVANCED_MENUS)
            {
                ButtonBibTexSniffer.Caption = LocalisationManager.Get("LIBRARY/CAP/BIBTEX_SNIFFER");
            }
            ButtonBibTexSniffer.ToolTip = LocalisationManager.Get("LIBRARY/TIP/BIBTEX_SNIFFER");
            ButtonBibTexSniffer.Click  += ButtonBibTexSniffer_Click;

            ButtonExplore.AttachPopup(ButtonExplorePopup);
            ButtonExplore.Icon = Icons.GetAppIcon(Icons.Explore);
            if (!ADVANCED_MENUS)
            {
                ButtonExplore.Caption = LocalisationManager.Get("LIBRARY/CAP/EXPLORE");
            }
            ButtonExplore.ToolTip    = LocalisationManager.Get("LIBRARY/TIP/EXPLORE");
            ButtonExplore.Visibility = ConfigurationManager.Instance.NoviceVisibility;

            ButtonExpedition.Icon    = Icons.GetAppIcon(Icons.ModuleExpedition);
            ButtonExpedition.Caption = LocalisationManager.Get("LIBRARY/TIP/EXPEDITION");
            ButtonExpedition.Click  += ButtonExpedition_Click;

            ButtonExploreInBrainstorm.Icon    = Icons.GetAppIcon(Icons.ModuleBrainstorm);
            ButtonExploreInBrainstorm.Caption = LocalisationManager.Get("LIBRARY/TIP/BRAINSTORM");
            ButtonExploreInBrainstorm.Click  += ButtonExploreInBrainstorm_Click;

            ButtonExploreInPivot.Icon    = Icons.GetAppIcon(Icons.LibraryPivot);
            ButtonExploreInPivot.Caption = LocalisationManager.Get("LIBRARY/TIP/PIVOT");
            ButtonExploreInPivot.Click  += ButtonExploreInPivot_Click;

            ButtonExport.AttachPopup(ButtonExportPopup);
            ButtonExport.Icon = Icons.GetAppIcon(Icons.LibraryExport);
            if (!ADVANCED_MENUS)
            {
                ButtonExport.Caption = LocalisationManager.Get("LIBRARY/CAP/POPUP_EXPORT");
            }
            ButtonExport.ToolTip    = LocalisationManager.Get("LIBRARY/TIP/POPUP_EXPORT");
            ButtonExport.Visibility = ConfigurationManager.Instance.NoviceVisibility;

            ButtonExportLibrary.Icon    = Icons.GetAppIcon(Icons.LibraryExport);
            ButtonExportLibrary.Caption = LocalisationManager.Get("LIBRARY/CAP/EXPORT_LIBRARY");
            ButtonExportLibrary.ToolTip = LocalisationManager.Get("LIBRARY/TIP/EXPORT_LIBRARY");
            ButtonExportLibrary.Click  += ButtonExportLibrary_Click;

            ButtonExportBibTex.Icon    = Icons.GetAppIcon(Icons.ExportBibTex);
            ButtonExportBibTex.Caption = LocalisationManager.Get("LIBRARY/CAP/EXPORT_BIBTEX");
            ButtonExportBibTex.ToolTip = LocalisationManager.Get("LIBRARY/TIP/EXPORT_BIBTEX");
            ButtonExportBibTex.Click  += ButtonExportBibTex_Click;

            ButtonExportWord2007.Icon    = Icons.GetAppIcon(Icons.ExportWord2007);
            ButtonExportWord2007.Caption = LocalisationManager.Get("LIBRARY/CAP/EXPORT_WORD");
            ButtonExportWord2007.ToolTip = LocalisationManager.Get("LIBRARY/TIP/EXPORT_WORD");
            ButtonExportWord2007.Click  += ButtonExportWord2007_Click;

            ButtonExportCitationMatrix.Icon    = Icons.GetAppIcon(Icons.ExportCitationMatrix);
            ButtonExportCitationMatrix.Caption = LocalisationManager.Get("LIBRARY/CAP/EXPORT_CITATION_MATRIX");
            ButtonExportCitationMatrix.ToolTip = LocalisationManager.Get("LIBRARY/TIP/EXPORT_CITATION_MATRIX");
            ButtonExportCitationMatrix.Click  += ButtonExportCitationMatrix_Click;

            ButtonExportLinkedDocs.Icon    = Icons.GetAppIcon(Icons.ExportCitationMatrix);
            ButtonExportLinkedDocs.Caption = LocalisationManager.Get("LIBRARY/CAP/EXPORT_LINKED_DOCS");
            ButtonExportLinkedDocs.ToolTip = LocalisationManager.Get("LIBRARY/TIP/EXPORT_LINKED_DOCS");
            ButtonExportLinkedDocs.Click  += ButtonExportLinkedDocs_Click;

            ButtonBuildBundleLibrary.Icon    = Icons.GetAppIcon(Icons.BuildBundleLibrary);
            ButtonBuildBundleLibrary.Caption = LocalisationManager.Get("LIBRARY/CAP/BUILD_BUNDLE_LIBRARY");
            ButtonBuildBundleLibrary.ToolTip = LocalisationManager.Get("LIBRARY/TIP/BUILD_BUNDLE_LIBRARY");
            ButtonBuildBundleLibrary.Click  += ButtonBuildBundleLibrary_Click;

            ButtonExportAnnotationsCode.Icon    = Icons.GetAppIcon(Icons.ExportBibTex);
            ButtonExportAnnotationsCode.Caption = LocalisationManager.Get("LIBRARY/CAP/EXPORT_ANNOTATIONS_CODE");
            ButtonExportAnnotationsCode.ToolTip = LocalisationManager.Get("LIBRARY/TIP/EXPORT_ANNOTATIONS_CODE");
            ButtonExportAnnotationsCode.Click  += ButtonExportAnnotationsCode_Click;

            ButtonAddDocuments.Icon    = Icons.GetAppIcon(Icons.DocumentsAddToLibrary);
            ButtonAddDocuments.Caption = LocalisationManager.Get("LIBRARY/CAP/ADD_DOCUMENTS");
            ButtonAddDocuments.ToolTip = LocalisationManager.Get("LIBRARY/TIP/ADD_DOCUMENTS");
            ButtonAddDocuments.Click  += ButtonAddDocuments_Click;

            ButtonAddDocumentsFromFolder.Icon    = Icons.GetAppIcon(Icons.DocumentsAddToLibraryFromFolder);
            ButtonAddDocumentsFromFolder.Caption = LocalisationManager.Get("LIBRARY/CAP/ADD_FOLDER");
            ButtonAddDocumentsFromFolder.ToolTip = LocalisationManager.Get("LIBRARY/TIP/ADD_FOLDER");
            ButtonAddDocumentsFromFolder.Click  += ButtonAddDocumentsFromFolder_Click;

            ButtonAddDocumentsFromLibrary.Icon    = Icons.GetAppIcon(Icons.DocumentsAddToLibraryFromLibrary);
            ButtonAddDocumentsFromLibrary.Caption = LocalisationManager.Get("LIBRARY/CAP/ADD_LIBRARY");
            ButtonAddDocumentsFromLibrary.ToolTip = LocalisationManager.Get("LIBRARY/TIP/ADD_LIBRARY");
            ButtonAddDocumentsFromLibrary.Click  += ButtonAddDocumentsFromLibrary_Click;

            ButtonWatchFolder.Icon    = Icons.GetAppIcon(Icons.DocumentsWatchFolder);
            ButtonWatchFolder.Caption = LocalisationManager.Get("LIBRARY/CAP/WATCH_FOLDER");
            ButtonWatchFolder.ToolTip = LocalisationManager.Get("LIBRARY/TIP/WATCH_FOLDER");
            ButtonWatchFolder.Click  += ButtonWatchFolder_Click;

            ButtonImportFromThirdParty.Icon    = Icons.GetAppIcon(Icons.DocumentsImportFromThirdParty);
            ButtonImportFromThirdParty.Caption = LocalisationManager.Get("LIBRARY/CAP/ADD_IMPORT");
            ButtonImportFromThirdParty.ToolTip = LocalisationManager.Get("LIBRARY/TIP/ADD_IMPORT");
            ButtonImportFromThirdParty.Click  += ButtonImportFromThirdParty_Click;

            ButtonAddMissingDocumentsFromSelf.Icon    = Icons.GetAppIcon(Icons.DocumentsAddMissingFromSelf);
            ButtonAddMissingDocumentsFromSelf.Caption = "Recover unregistered PDFs in this library";
            ButtonAddMissingDocumentsFromSelf.ToolTip = "This is a live library recovery/restoration operation: inspect the current library's storage and re-register all PDFs in there, which have not been registered in the library already.";
            ButtonAddMissingDocumentsFromSelf.Click  += ButtonAddMissingDocumentsFromSelf_Click;

            ObjLibraryEmptyDescriptionText.Background = ThemeColours.Background_Brush_Blue_LightToDark;

            // Tie all our GUI objects together
            ObjLibraryFilterControl.library_filter_control_search = ObjLibraryFilterControl_Search;
            ObjLibraryFilterControl_Search.library_filter_control = ObjLibraryFilterControl;

            ObjLibraryFilterControl.OnFilterChanged += ObjLibraryFilterControl_OnFilterChanged;
            ObjLibraryFilterControl.OnFilterChanged += ObjLibraryFilterOverviewControl.OnFilterChanged;
            ObjLibraryFilterControl.OnFilterChanged += ObjLibraryCatalogControl.OnFilterChanged;

            ObjLibraryFilterControl.LibraryRef = web_library_detail;
            ObjLibraryFilterControl.ResetFilters(true);

            ObjLibraryCatalogControl.LibraryRef = web_library_detail;

            // Catch some keyboard commands
            KeyDown += LibraryControl_KeyDown;

            if (!ADVANCED_MENUS)
            {
                ButtonWebcast.Caption = "Tutorial\n";
            }
            Webcasts.FormatWebcastButton(ButtonWebcast, Webcasts.LIBRARY);

            // IF the library is read-only?
            ReflectReadOnlyStatus();

            Logging.Debug("-LibraryControl()");
        }