Docear4Word.DocumentController.Refresh C# (CSharp) Method

Refresh() public method

public Refresh ( bool fullRefresh ) : int
fullRefresh bool True to compare against database; False for style change
return int
        public int Refresh(bool fullRefresh)
        {
            try
            {
                isUpdating = true;

                ResetCiteProc();

                if (CiteProc == null)
                {
                    MessageBox.Show("Docear4Word could not process the selected style.\r\nPlease check the style is valid or choose a different style.\r\n\r\nFeel free to contact us telling us about the problem (please include the style file when sending an email). http://www.docear.org/docear/contact/", "Docear4Word", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return -1;
                }

                return new CitationInserter(this).Refresh(fullRefresh);
            }
            finally
            {
                isUpdating = false;
            }
        }

Usage Example

示例#1
0
        public void DoRefresh()
        {
            if (!CurrentDocumentControllerIsReady)
            {
                return;
            }

            var currentDatabase = currentDocumentController.GetDatabase();

            if (currentDatabase == null)
            {
                ShowNoDatabaseMessage();
                return;
            }

            var citationsUpdated = currentDocumentController.Refresh(true);

            if (citationsUpdated > 0)
            {
                MessageBox.Show(citationsUpdated == 1
                                                ? "One citation has been updated to match its entry in the Bibtex database."
                                                : citationsUpdated + " citations have been updated to match their entries in the Bibtex database."
                                , "Docear4Word");
            }
        }