/// -------------------------------------------------------------------------------- /// <summary> /// Refreshes the list of Paratext projects. /// </summary> /// -------------------------------------------------------------------------------- public void RefreshProjects() { try { if (ParatextSettingsDirectoryExists()) { if (!m_IsParatextInitialized) { // It is possible that the Projects directory was not available when we first initialized // ScrTextCollection, but it now is (e.g. USB drive plugged or unplugged). So we initialize // again. ScrTextCollection.Initialize is safe to call multiple times and also refreshes texts. // We pass the directory (rather than passing no arguments, and letting the paratext dll figure // it out) because the figuring out goes wrong on Linux, where both programs are simulating // the registry. ScrTextCollection.Initialize(ParatextSettingsDirectory(), false); m_IsParatextInitialized = true; } else { ScrTextCollection.RefreshScrTexts(); } } else { m_IsParatextInitialized = false; } } catch (Exception e) { Logger.WriteError(e); m_IsParatextInitialized = false; } }
/// -------------------------------------------------------------------------------- /// <summary> /// Refreshes the list of Paratext projects. /// </summary> /// -------------------------------------------------------------------------------- public void RefreshProjects() { try { ScrTextCollection.RefreshScrTexts(); } catch (Exception e) { Logger.WriteError(e); } }
/// -------------------------------------------------------------------------------- /// <summary> /// Gets the list of Paratext projects. /// </summary> /// -------------------------------------------------------------------------------- public IEnumerable <ScrText> GetProjects() { try { ScrTextCollection.RefreshScrTexts(); return(ScrTextCollection.ScrTexts); } catch (Exception e) { Logger.WriteError(e); return(new ScrText[0]); } }
public void RefreshScrTexts() { ScrTextCollection.RefreshScrTexts(); }