private void ButtonCitationSnippetToClipboard_Click(object sender, RoutedEventArgs e)
        {
            FeatureTrackingManager.Instance.UseFeature(Features.InCite_AddNewCitationSnippet);

            // Check that they have picked the two important things...
            if (!CheckThatLibraryAndStyleHaveBeenSelected())
            {
                return;
            }

            // Get the selected citations
            List <PDFDocument> selected_pdf_documents = library_control.ObjLibraryCatalogControl.SelectedPDFDocuments;

            if (0 == selected_pdf_documents.Count)
            {
                MessageBoxes.Warn("You have not selected any document(s) with which to create a citation snippet.");
                return;
            }

            string style_filename = GetStyleFilename();

            if (null != style_filename)
            {
                CSLProcessor.GenerateRtfCitationSnippet(false, selected_pdf_documents, style_filename, null);
            }

            e.Handled = true;
        }
        internal static void CiteSnippetPDFDocuments(bool suppress_messages, List <PDFDocument> pdf_documents, CSLProcessorOutputConsumer.BibliographyReadyDelegate brd = null)
        {
            foreach (var pdf_document in pdf_documents)
            {
                pdf_document.DateLastCited = DateTime.UtcNow;
            }

            string last_style_filename = GetLastStyleFilename();

            if (null != last_style_filename)
            {
                CSLProcessor.GenerateRtfCitationSnippet(suppress_messages, pdf_documents, last_style_filename, null, brd);
            }
        }
        internal static void RefreshBibliography()
        {
            try
            {
                string last_style_filename = GetLastStyleFilename();
                if (null != last_style_filename)
                {
                    CSLProcessor.RefreshDocument(WordConnector.Instance, last_style_filename, null);
                }
            }

            catch (Exception ex)
            {
                Logging.Error(ex, "Exception while refreshing bibliography.");
                MessageBoxes.Error("There has been a problem while trying to add the citation.  Please check that Microsoft Word is running.\n\nIf the problem persists, perhaps open InCite from the Start Page as it may offer more details about the problem.");
            }
        }
        private void ButtonRefresh_Click(object sender, RoutedEventArgs e)
        {
            FeatureTrackingManager.Instance.UseFeature(Features.InCite_Refresh);

            // Check that they have picked the two important things...
            if (!CheckThatLibraryAndStyleHaveBeenSelected())
            {
                return;
            }

            string style_filename = GetStyleFilename();

            if (null != style_filename)
            {
                CSLProcessor.RefreshDocument(WordConnector.Instance, style_filename, DefaultLibrary);
            }

            e.Handled = true;
        }