C# 클래스 SIL.FieldWorks.TE.TeImportManager

Helper class that manages the different aspects of import: interacting with user, settings and then delegating the real work...
파일 보기 프로젝트 열기: sillsdev/FieldWorks 1 사용 예제들

공개 메소드들

메소드 설명
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