Import() public static method

This static method imports Scripture (This overload used only for testing w/o merge or overwrite dialog.)
public static Import ( IScrImportSet settings, SIL.FieldWorks.FDO.FdoCache cache, FwStyleSheet styleSheet, SIL.FieldWorks.TE.UndoImportManager undoManager ) : ScrReference
settings IScrImportSet Import settings object (filled in by wizard)
cache SIL.FieldWorks.FDO.FdoCache The cache used to import to and get misc. info. from.
styleSheet FwStyleSheet Stylesheet from which to get scripture styles.
undoManager SIL.FieldWorks.TE.UndoImportManager The undo import manager (which is responsible for creating /// and maintaining the archive of original books being overwritten and maintaining /// the book filter).
return ScrReference
Ejemplo n.º 1
0
		/// ------------------------------------------------------------------------------------
		/// <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.
		}
Ejemplo n.º 2
0
		/// ------------------------------------------------------------------------------------
		/// <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.
		}