C# Класс SIL.FieldWorks.TE.TeImportManager

Helper class that manages the different aspects of import: interacting with user, settings and then delegating the real work...
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
ImportParatext ( Form mainWnd, FwStyleSheet stylesheet, FwApp app ) : bool

Perform a Paratext streamlined import

ImportSf ( FwMainWnd mainWnd, ITeImportCallbacks importCallbacks, FwApp app ) : void

Perform the Standard Format import

ImportXml ( FwMainWnd mainWnd, ITeImportCallbacks importCallbacks, FwApp app ) : void

Import an OXES (Open XML for Editing Scripture) file.

Защищенные методы

Метод Описание
CompleteImport ( ScrReference firstImported ) : ScrReference

Completes the import.

CreateTeImportUi ( ProgressDialogWithTask progressDialog ) : TeImportUi

Creates a TeImportUi object.

Can be overriden in tests

DisplayImportedBooksDlg ( IScrDraft backupSavedVersion ) : void

Displays the imported books dialog box (virtual to allow tests to suppress display of dialog box).

GetImportSettings ( ) : IScrImportSet

Get the settings for Import, either from database or from wizard

Import ( IScrImportSet importSettings, SIL.FieldWorks.TE.UndoImportManager undoManager, TeImportUi importUi ) : ScrReference

Calls the importer.

ImportSf ( ) : bool

Get settings for and perform the Standard Format import

ImportWithUndoTask ( IScrImportSet importSettings, bool fDisplayUi, string updateDescription ) : ScrReference

Import scripture and embed it in a Undo task so that it is undoable. Nb: this creates a Mark in the undo stack (unless no books at all are imported or an error occurs), which is designed to be 'collapsed' to after all books in the batch are imported, so we get a single Undo task for the whole Import in the end. Code (such as tests) that calls this directly should call UndoManager.CollapseAllUndoActions().

ImportXml ( ) : void

Prepare for and perform the OXES import.

ParatextProjHasUnmappedMarkers ( IScrImportSet settings ) : bool

Iterate through the ScriptureTexts' lists of tags. If any missing mappings are found return true to give the user a chance to use the ImportWizard to map everything.

ParatextProjHasUnmappedMarkers ( string sParatextProjectId ) : bool

Iterate through the ScriptureText's list of tags. If any missing mappings are found return true to give the user a chance to use the ImportWizard to map everything.

TeImportManager ( SIL.FieldWorks.FDO.FdoCache cache, FwStyleSheet styleSheet, IApp app, bool fParatextStreamlinedImport ) : System

Initializes a new instance of the TeImportManager class.

This version is for testing only

Приватные методы

Метод Описание
DoImport ( IScrImportSet importSettings, string updateDescription ) : bool

Does the import.

GetDialogCaption ( ErrorCodeType codeType ) : string

Gets the caption for the Unable to Import message box.

ImportTask ( IProgress progressDlg, object parameters ) : object

The import task.

InternalImport ( IScrImportSet importSettings, bool fDisplayUi ) : ScrReference
SetSelectionsAfterImport ( ScrReference firstReference ) : void

Set selections after import.

TeImportManager ( Form mainWnd, FwStyleSheet styleSheet, FwApp app, bool fParatextStreamlinedImport ) : System

Initializes a new instance of the TeImportManager class.

TeImportManager ( FwMainWnd mainWnd, ITeImportCallbacks importCallbacks, FwApp app, bool fParatextStreamlinedImport ) : System

Initializes a new instance of the TeImportManager class.

Описание методов

CompleteImport() защищенный метод

Completes the import.
protected CompleteImport ( ScrReference firstImported ) : ScrReference
firstImported ScrReference The reference of the first thing that was imported
Результат ScrReference

CreateTeImportUi() защищенный метод

Creates a TeImportUi object.
Can be overriden in tests
protected CreateTeImportUi ( ProgressDialogWithTask progressDialog ) : TeImportUi
progressDialog SIL.FieldWorks.Common.Controls.ProgressDialogWithTask The progress dialog.
Результат TeImportUi

DisplayImportedBooksDlg() защищенный метод

Displays the imported books dialog box (virtual to allow tests to suppress display of dialog box).
protected DisplayImportedBooksDlg ( IScrDraft backupSavedVersion ) : void
backupSavedVersion IScrDraft The saved version for backups of any overwritten /// books.
Результат void

GetImportSettings() защищенный метод

Get the settings for Import, either from database or from wizard
protected GetImportSettings ( ) : IScrImportSet
Результат IScrImportSet

Import() защищенный метод

Calls the importer.
protected Import ( IScrImportSet importSettings, SIL.FieldWorks.TE.UndoImportManager undoManager, TeImportUi importUi ) : ScrReference
importSettings IScrImportSet The import settings.
undoManager SIL.FieldWorks.TE.UndoImportManager The undo manager.
importUi TeImportUi The import UI.
Результат ScrReference

ImportParatext() публичный статический метод

Perform a Paratext streamlined import
public static ImportParatext ( Form mainWnd, FwStyleSheet stylesheet, FwApp app ) : bool
mainWnd System.Windows.Forms.Form The main window.
stylesheet FwStyleSheet The Scripture stylesheet.
app SIL.FieldWorks.Common.Framework.FwApp The app.
Результат bool

ImportSf() защищенный метод

Get settings for and perform the Standard Format import
protected ImportSf ( ) : bool
Результат bool

ImportSf() публичный статический метод

Perform the Standard Format import
public static ImportSf ( FwMainWnd mainWnd, ITeImportCallbacks importCallbacks, FwApp app ) : void
mainWnd SIL.FieldWorks.Common.Framework.FwMainWnd The main window.
importCallbacks ITeImportCallbacks The import callbacks.
app SIL.FieldWorks.Common.Framework.FwApp The app.
Результат void

ImportWithUndoTask() защищенный метод

Import scripture and embed it in a Undo task so that it is undoable. Nb: this creates a Mark in the undo stack (unless no books at all are imported or an error occurs), which is designed to be 'collapsed' to after all books in the batch are imported, so we get a single Undo task for the whole Import in the end. Code (such as tests) that calls this directly should call UndoManager.CollapseAllUndoActions().
protected ImportWithUndoTask ( IScrImportSet importSettings, bool fDisplayUi, string updateDescription ) : ScrReference
importSettings IScrImportSet The SFM import settings. If null, then this is an XML import.
fDisplayUi bool set to true to display the progress dialog, /// false to run without UI.
updateDescription string description of the data update being done (i.e., /// which type of import).
Результат ScrReference

ImportXml() защищенный метод

Prepare for and perform the OXES import.
protected ImportXml ( ) : void
Результат void

ImportXml() публичный статический метод

Import an OXES (Open XML for Editing Scripture) file.
public static ImportXml ( FwMainWnd mainWnd, ITeImportCallbacks importCallbacks, FwApp app ) : void
mainWnd SIL.FieldWorks.Common.Framework.FwMainWnd The main WND.
importCallbacks ITeImportCallbacks The import callbacks.
app SIL.FieldWorks.Common.Framework.FwApp The app.
Результат void

ParatextProjHasUnmappedMarkers() защищенный метод

Iterate through the ScriptureTexts' lists of tags. If any missing mappings are found return true to give the user a chance to use the ImportWizard to map everything.
protected ParatextProjHasUnmappedMarkers ( IScrImportSet settings ) : bool
settings IScrImportSet Import settings object
Результат bool

ParatextProjHasUnmappedMarkers() защищенный метод

Iterate through the ScriptureText's list of tags. If any missing mappings are found return true to give the user a chance to use the ImportWizard to map everything.
protected ParatextProjHasUnmappedMarkers ( string sParatextProjectId ) : bool
sParatextProjectId string P6 project id
Результат bool

TeImportManager() защищенный метод

Initializes a new instance of the TeImportManager class.
This version is for testing only
protected TeImportManager ( SIL.FieldWorks.FDO.FdoCache cache, FwStyleSheet styleSheet, IApp app, bool fParatextStreamlinedImport ) : System
cache SIL.FieldWorks.FDO.FdoCache The cache.
styleSheet FwStyleSheet The style sheet.
app IApp The app.
fParatextStreamlinedImport bool if set to true do a Paratext /// streamlined import (minimal UI).
Результат System