/// ------------------------------------------------------------------------------------ /// <summary> /// Call this static method to Import Scripture /// </summary> /// <param name="settings">Import settings object (filled in by wizard)</param> /// <param name="cache">The cache used to import to and get misc. info. from.</param> /// <param name="styleSheet">Stylesheet from which to get scripture styles.</param> /// <param name="undoManager">The undo import manager (which is responsible for creating /// and maintaining the archive of original books being overwritten and maintaining /// the book filter).</param> /// <param name="importCallbacks">UI callbacks</param> /// <returns> /// The Scripture reference of the first thing that was imported /// </returns> /// ------------------------------------------------------------------------------------ public static ScrReference Import(IScrImportSet settings, FdoCache cache, FwStyleSheet styleSheet, UndoImportManager undoManager, TeImportUi importCallbacks) { using (TeSfmImporter importer = new TeSfmImporter(settings, cache, styleSheet, undoManager, importCallbacks)) { importer.Import(); return importer.m_firstImportedRef; } // Dispose() releases any hold on ICU character properties. }
/// ------------------------------------------------------------------------------------ /// <summary> /// Call this static method to Import Scripture /// </summary> /// <param name="settings">Import settings object (filled in by wizard)</param> /// <param name="cache">The cache used to import to and get misc. info. from.</param> /// <param name="styleSheet">Stylesheet from which to get scripture styles.</param> /// <param name="undoManager">The undo import manager (which is responsible for creating /// and maintaining the archive of original books being overwritten and maintaining /// the book filter).</param> /// <param name="importCallbacks">UI callbacks</param> /// <param name="streamLinedImport">flag indicated if import id done through FLEx.</param> /// <returns> /// The Scripture reference of the first thing that was imported /// </returns> /// ------------------------------------------------------------------------------------ public static ScrReference Import(IScrImportSet settings, FdoCache cache, FwStyleSheet styleSheet, UndoImportManager undoManager, TeImportUi importCallbacks, bool streamLinedImport = false) { using (TeSfmImporter importer = new TeSfmImporter(settings, cache, styleSheet, undoManager, importCallbacks, streamLinedImport)) { importer.Import(); importCallbacks.AllowCancel = false; // LT-16647: Disallow canceling import after it is complete (before disposing importer). return importer.m_firstImportedRef; } // Dispose() releases any hold on ICU character properties. }