GetDatabase() public method

public GetDatabase ( ) : BibTexDatabase
return BibTexDatabase
Beispiel #1
0
            public int Refresh(bool fullRefresh)
            {
                // Is this the best place to do this??
                ClearCitationsCache();

                var changesMade = fullRefresh
                                                ? UpdateCitationsFromDatabase(documentController.GetDatabase())
                                                : -1;

                var jsCitations = Reset();

                var jsResult = citeProc.RestoreProcessorState(jsCitations);

                try
                {
                    SuspendRedraw();

                    ApplyResult(jsResult);

                    UpdateBibliographyFields();
                }
                finally
                {
                    ResumeRedraw();
                }

                return(changesMade);
            }
Beispiel #2
0
        public void DoInsertTestData()
        {
            Debug.Assert(currentDocumentController != null);

            var bibTexDatabase = currentDocumentController.GetDatabase();

            if (bibTexDatabase == null)
            {
                return;
            }

            var entries = new List <Entry>(bibTexDatabase.Entries);

            if (entries.Count < 1)
            {
                return;
            }

            var selectedEntry = new List <EntryAndPagePair>
            {
                new EntryAndPagePair(entries[0]),
            };

            currentDocumentController.InsertCitation(selectedEntry);

            if (entries.Count >= 3)
            {
                var selectedEntries = new List <EntryAndPagePair>
                {
                    new EntryAndPagePair(entries[1], pageNumberOverride: "123"),
                    new EntryAndPagePair(entries[2], pageNumberOverride: "456"),
                };

                currentDocumentController.InsertCitation(selectedEntries);
            }

            var document  = currentDocumentController.Document;
            var selection = document.Application.Selection;

            selection.Collapse(WdCollapseDirection.wdCollapseEnd);
            selection.Paragraphs.Add();

            currentDocumentController.InsertBibliography();
            OnWindowSelectionChange();
        }