C# Class SIL.FieldWorks.TE.ImportWizard

The ImportWizard class guides the user through the process of establishing import settings for TE and/or for defining the project settings for shadowing or converting a Standard Format project for access by ScriptureObjects.
Inheritance: System.Windows.Forms.Form, IFWDisposable
Afficher le fichier Open project: sillsdev/FieldWorks Class Usage Examples

Protected Properties

Свойство Type Description
cboPTBackTrans SIL.FieldWorks.Common.Controls.FwOverrideComboBox
cboPTLangProj SIL.FieldWorks.Common.Controls.FwOverrideComboBox
cboPTTransNotes SIL.FieldWorks.Common.Controls.FwOverrideComboBox
lvScrMappings SIL.FieldWorks.Common.Controls.FwListView
m_MappingDialog SIL.FieldWorks.TE.ModifyMapping
m_PTLangProjects List
m_ScriptureText ISCScriptureText
m_StyleSheet FwStyleSheet
m_btnAddNoteMapping System.Windows.Forms.Button
m_btnAddScrMapping System.Windows.Forms.Button
m_btnBack System.Windows.Forms.Button
m_btnCurrentAddButton System.Windows.Forms.Button
m_btnCurrentDeleteButton System.Windows.Forms.Button
m_btnCurrentModifyButton System.Windows.Forms.Button
m_btnDeleteNoteMapping System.Windows.Forms.Button
m_btnDeleteScrMapping System.Windows.Forms.Button
m_btnModifyNoteMapping System.Windows.Forms.Button
m_btnModifyScrMapping System.Windows.Forms.Button
m_btnNext System.Windows.Forms.Button
m_cache SIL.FieldWorks.FDO.FdoCache
m_fShowAllMappings bool
m_inlineMappingDialog SIL.FieldWorks.TE.CharacterMappingSettings
m_lvCurrentMappingList SIL.FieldWorks.Common.Controls.FwListView
m_projectType ProjectTypes
m_scr IScripture
m_settings IScrImportSet
rbOther System.Windows.Forms.RadioButton
rbParatext5 System.Windows.Forms.RadioButton
rbParatext6 System.Windows.Forms.RadioButton
sfFileListBuilder SIL.FieldWorks.Common.Controls.SFFileListBuilder

Méthodes publiques

Méthode Description
CheckDisposed ( ) : void

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.

DisplayMappingDialog ( Form dlg ) : void

Shows the dlg modally. This is a public virtual so that test code can override it.

ImportWizard ( string langProjName, IScripture scr, FwStyleSheet styleSheet, IHelpTopicProvider helpTopicProvider, IApp app ) : System

Constructor for runtime.

Méthodes protégées

Méthode Description
DisplayInlineMappingDialog ( SIL.FieldWorks.FDO.DomainServices.ImportMappingInfo mapping ) : void

Creates (if necessary) and shows the CharacterMappingSettings dialog. This is a public virtual so that test code can override it.

Dispose ( bool disposing ) : void

Clean up any resources being used.

IsDup ( string beginMarker ) : bool

Handles the CharacterMappingsettings.IsDuplicateMapping event. Checks for duplicate begin marker, unless we're just modifying other properties of an existing one. ///

LoadMappingsFromSettings ( ) : void

This method gets all the mappings from the ScrImportSet and loads them into a list view so the user can modify them if necessary.

LoadMappingsFromSettings ( SIL.FieldWorks.Common.Controls.FwListView lv, MappingSet mappingSet ) : void

This method gets all the mappings from the ScrImportSet and loads them into a list view so the user can modify them if necessary.

OnClosing ( CancelEventArgs e ) : void

Save in the registry the dialog's location and size along with the widths of the list view columns.

OnFilesChanged ( ) : void

If there aren't any files for SFM import, this event handler prevents the user from continuing in the wizard.

OnLoad ( EventArgs e ) : void

OnPaint ( PaintEventArgs e ) : void

This will draw the the etched line that separates the dialog's buttons at the bottom from the rest of the dialog.

btnAdd_Click ( object sender, EventArgs e ) : void

Display the Add Character Mapping Settings dialog box

btnDelete_Click ( object sender, EventArgs e ) : void

lvMappings_SelectedIndexChanged ( object sender, EventArgs e ) : void

Prevent user from changing mapping for chapter and verse markers. If there are no markers at all disable modify button as well.

m_btnBack_Click ( object sender, EventArgs e ) : void

Handles the Click event of the m_btnBack control.

m_btnModify_Click ( object sender, EventArgs e ) : void

m_btnNext_Click ( object sender, EventArgs e ) : void

Handles the Click event of the m_btnNext control.

Private Methods

Méthode Description
CheckProjectCombo ( string projName, SIL.FieldWorks.Common.Controls.FwOverrideComboBox projCombo, ImportDomain domain ) : void

Checks the contents of the project combo. We call this after we attempt to assign the projName in the import settings to the current selection in the project combo box.

DefineImportSettings ( TypeOfImport importType ) : void

Defines the import settings given a type of import (Paratext5, Paratext6 or Other). Either we find import settings in the database or create a new set.

FindParatextProjects ( ) : bool

Loads a list with the Paratext projects on a user's system.

GetMappingDetailsAsString ( SIL.FieldWorks.FDO.DomainServices.ImportMappingInfo mapping ) : string

For the given mapping, compute a string to display in the details column of the mapping list.

GetPTShortName ( SIL.FieldWorks.Common.Controls.FwOverrideComboBox cbo ) : string

Gets the selected ParaText project short name from the selected item in a combo box list.

ImportWizard ( ) : System

Initializes the ImportWizard class.

InitializeComponent ( ) : void

Required method for Designer support - do not modify the contents of this method with the code editor.

InitializeScrImportSettings ( ) : void

Initializes the Scripture import settings object. This should be called whenever m_settings is reassigned to a new instance of the ScrImportSet class.

LoadLVMappingItem ( SIL.FieldWorks.Common.Controls.FwListView lv, SIL.FieldWorks.FDO.DomainServices.ImportMappingInfo mapping ) : System.Windows.Forms.ListViewItem

This method will add or modify a single mapping to the list view.

LoadLVMappingItem ( SIL.FieldWorks.Common.Controls.FwListView lv, System.Windows.Forms.ListViewItem item, SIL.FieldWorks.FDO.DomainServices.ImportMappingInfo mapping ) : System.Windows.Forms.ListViewItem

This method will add or modify a single mapping in the list view.

LoadParatextProjectCombo ( SIL.FieldWorks.Common.Controls.FwOverrideComboBox cbo, string selectedProj ) : void

Load the given combobox and select the selected project, if any.

LoadParatextProjectCombos ( ) : void
MappingContextMenu_Click ( object sender, EventArgs e ) : void

Process a menu item click on the context menu

MappingStyleNameAsUIString ( SIL.FieldWorks.FDO.DomainServices.ImportMappingInfo mapping ) : string

PrepareToGetOtherProjectSettings ( ) : void

This method is called after the user has chosen to import a non Paratext project (e.g. a standard format project). Prepare to get the settings for that import.

PrepareToGetParatextProjectSettings ( ) : bool

This method is called after the user has chosen to import a Paratext project. Prepare to get the settings for that import by first, making sure there are Paratext projects on the system, and if there is, loading misc. information about the projects in order for the user to specify the import settings.

RestoreWindowsSettings ( ) : void

Get, from the registry, the dialog's location and size along with the widths of the list view columns.

SetParatextProjectIds ( ) : bool

Store in the settings the Paratext projects selected in the combo boxes from the project location step, provided they are valid projects.

UpdateStepLabel ( ) : void

ValidToGoForward ( ) : bool
cboShowMappings_SelectedIndexChanged ( object sender, EventArgs e ) : void

Handles the SelectedIndexChanged event of the cboShowMappings control.

lvMappings_DoubleClick ( object sender, EventArgs e ) : void

Handles the double click on the listview. It will make it modify the item double-clicked.

lvMappings_DrawSubItem ( object sender, DrawListViewSubItemEventArgs e ) : void

Handles the DrawSubItem event of the lvMappings control.

m_btnHelp_Click ( object sender, EventArgs e ) : void

Open the help window when the help button is pressed.

m_cmMappings_Popup ( object sender, EventArgs e ) : void

Set the context menu's checked properties appropriately before showing the menu.

panStep1_VisibleChanged ( object sender, EventArgs e ) : void

panStep2_Other_VisibleChanged ( object sender, EventArgs e ) : void

Make sure the next button is disabled when the file list is empty.

panStep2_PT_VisibleChanged ( object sender, EventArgs e ) : void

Make sure the next button is disabled when there are no paratext projects available

panStep3_VisibleChanged ( object sender, EventArgs e ) : void

Fill the mappings listview with all mappings from the Paratext project(s) or SF files.

rbOther_CheckedChanged ( object sender, EventArgs e ) : void

Handles the CheckedChanged event of the rbOther control (Other USFM radio button).

rbParatext5_CheckedChanged ( object sender, EventArgs e ) : void

Handles the CheckedChanged event of the rbParatext5 control (Paratext 5 radio button).

rbParatext6_CheckedChanged ( object sender, EventArgs e ) : void

Handles the CheckedChanged event of the rbParatext6 control (Paratext 6 radio button).

tabCtrlMappings_SelectedIndexChanged ( object sender, EventArgs e ) : void

Handles the SelectedIndexChanged event of the tabCtrlMappings control.

Method Details

CheckDisposed() public méthode

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.
public CheckDisposed ( ) : void
Résultat void

DisplayInlineMappingDialog() protected méthode

Creates (if necessary) and shows the CharacterMappingSettings dialog. This is a public virtual so that test code can override it.
protected DisplayInlineMappingDialog ( SIL.FieldWorks.FDO.DomainServices.ImportMappingInfo mapping ) : void
mapping SIL.FieldWorks.FDO.DomainServices.ImportMappingInfo Provides intial values displayed in dialog.
Résultat void

DisplayMappingDialog() public méthode

Shows the dlg modally. This is a public virtual so that test code can override it.
public DisplayMappingDialog ( Form dlg ) : void
dlg System.Windows.Forms.Form The dialog to show
Résultat void

Dispose() protected méthode

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

ImportWizard() public méthode

Constructor for runtime.
public ImportWizard ( string langProjName, IScripture scr, FwStyleSheet styleSheet, IHelpTopicProvider helpTopicProvider, IApp app ) : System
langProjName string Name of the lang proj.
scr IScripture The Scripture object.
styleSheet FwStyleSheet The styleSheet
helpTopicProvider IHelpTopicProvider The help topic provider.
app IApp The app.
Résultat System

IsDup() protected méthode

Handles the CharacterMappingsettings.IsDuplicateMapping event. Checks for duplicate begin marker, unless we're just modifying other properties of an existing one. ///
protected IsDup ( string beginMarker ) : bool
beginMarker string
Résultat bool

LoadMappingsFromSettings() protected méthode

This method gets all the mappings from the ScrImportSet and loads them into a list view so the user can modify them if necessary.
protected LoadMappingsFromSettings ( ) : void
Résultat void

LoadMappingsFromSettings() protected méthode

This method gets all the mappings from the ScrImportSet and loads them into a list view so the user can modify them if necessary.
protected LoadMappingsFromSettings ( SIL.FieldWorks.Common.Controls.FwListView lv, MappingSet mappingSet ) : void
lv SIL.FieldWorks.Common.Controls.FwListView The list view to add mappings to
mappingSet MappingSet The set of mappings to add
Résultat void

OnClosing() protected méthode

Save in the registry the dialog's location and size along with the widths of the list view columns.
protected OnClosing ( CancelEventArgs e ) : void
e CancelEventArgs
Résultat void

OnFilesChanged() protected méthode

If there aren't any files for SFM import, this event handler prevents the user from continuing in the wizard.
protected OnFilesChanged ( ) : void
Résultat void

OnLoad() protected méthode

protected OnLoad ( EventArgs e ) : void
e System.EventArgs
Résultat void

OnPaint() protected méthode

This will draw the the etched line that separates the dialog's buttons at the bottom from the rest of the dialog.
protected OnPaint ( PaintEventArgs e ) : void
e PaintEventArgs
Résultat void

btnAdd_Click() protected méthode

Display the Add Character Mapping Settings dialog box
protected btnAdd_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Résultat void

btnDelete_Click() protected méthode

protected btnDelete_Click ( object sender, EventArgs e ) : void
sender object Not used
e System.EventArgs Not used
Résultat void

lvMappings_SelectedIndexChanged() protected méthode

Prevent user from changing mapping for chapter and verse markers. If there are no markers at all disable modify button as well.
protected lvMappings_SelectedIndexChanged ( object sender, EventArgs e ) : void
sender object Not used
e System.EventArgs Not used
Résultat void

m_btnBack_Click() protected méthode

Handles the Click event of the m_btnBack control.
protected m_btnBack_Click ( object sender, EventArgs e ) : void
sender object The source of the event.
e System.EventArgs The instance containing the event /// data.
Résultat void

m_btnModify_Click() protected méthode

protected m_btnModify_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Résultat void

m_btnNext_Click() protected méthode

Handles the Click event of the m_btnNext control.
protected m_btnNext_Click ( object sender, EventArgs e ) : void
sender object The source of the event.
e System.EventArgs The instance containing the event /// data.
Résultat void

Property Details

cboPTBackTrans protected_oe property

Protected for Tests
protected FwOverrideComboBox,SIL.FieldWorks.Common.Controls cboPTBackTrans
Résultat SIL.FieldWorks.Common.Controls.FwOverrideComboBox

cboPTLangProj protected_oe property

Protected for Tests
protected FwOverrideComboBox,SIL.FieldWorks.Common.Controls cboPTLangProj
Résultat SIL.FieldWorks.Common.Controls.FwOverrideComboBox

cboPTTransNotes protected_oe property

Protected for Tests
protected FwOverrideComboBox,SIL.FieldWorks.Common.Controls cboPTTransNotes
Résultat SIL.FieldWorks.Common.Controls.FwOverrideComboBox

lvScrMappings protected_oe property

Protected for Tests
protected FwListView,SIL.FieldWorks.Common.Controls lvScrMappings
Résultat SIL.FieldWorks.Common.Controls.FwListView

m_MappingDialog protected_oe property

The modify mappings dialog used for non-inline mappings or mappings that are "in use." We need this variable for testing purposes so that we can create a mock dialog.
protected ModifyMapping,SIL.FieldWorks.TE m_MappingDialog
Résultat SIL.FieldWorks.TE.ModifyMapping

m_PTLangProjects protected_oe property

protected List m_PTLangProjects
Résultat List

m_ScriptureText protected_oe property

protected ISCScriptureText m_ScriptureText
Résultat ISCScriptureText

m_StyleSheet protected_oe property

protected FwStyleSheet m_StyleSheet
Résultat FwStyleSheet

m_btnAddNoteMapping protected_oe property

protected Button,System.Windows.Forms m_btnAddNoteMapping
Résultat System.Windows.Forms.Button

m_btnAddScrMapping protected_oe property

Protected for Tests
protected Button,System.Windows.Forms m_btnAddScrMapping
Résultat System.Windows.Forms.Button

m_btnBack protected_oe property

Protected for Tests
protected Button,System.Windows.Forms m_btnBack
Résultat System.Windows.Forms.Button

m_btnCurrentAddButton protected_oe property

Either m_btnAddScrMapping or m_btnAddAnnotMapping
protected Button,System.Windows.Forms m_btnCurrentAddButton
Résultat System.Windows.Forms.Button

m_btnCurrentDeleteButton protected_oe property

Either m_btnDeleteScrMapping or m_btnDeleteAnnotMapping
protected Button,System.Windows.Forms m_btnCurrentDeleteButton
Résultat System.Windows.Forms.Button

m_btnCurrentModifyButton protected_oe property

Either m_btnModifyScrMapping or m_btnModifyAnnotMapping
protected Button,System.Windows.Forms m_btnCurrentModifyButton
Résultat System.Windows.Forms.Button

m_btnDeleteNoteMapping protected_oe property

protected Button,System.Windows.Forms m_btnDeleteNoteMapping
Résultat System.Windows.Forms.Button

m_btnDeleteScrMapping protected_oe property

protected Button,System.Windows.Forms m_btnDeleteScrMapping
Résultat System.Windows.Forms.Button

m_btnModifyNoteMapping protected_oe property

protected Button,System.Windows.Forms m_btnModifyNoteMapping
Résultat System.Windows.Forms.Button

m_btnModifyScrMapping protected_oe property

Protected for Tests
protected Button,System.Windows.Forms m_btnModifyScrMapping
Résultat System.Windows.Forms.Button

m_btnNext protected_oe property

Protected for Tests
protected Button,System.Windows.Forms m_btnNext
Résultat System.Windows.Forms.Button

m_cache protected_oe property

protected FdoCache,SIL.FieldWorks.FDO m_cache
Résultat SIL.FieldWorks.FDO.FdoCache

m_fShowAllMappings protected_oe property

Indicates whether to show all mappings or only those in use.
protected bool m_fShowAllMappings
Résultat bool

m_inlineMappingDialog protected_oe property

The modify mappings dialog used for user-created in-line mappings. We need this variable for testing purposes so that we can create a mock dialog.
protected CharacterMappingSettings,SIL.FieldWorks.TE m_inlineMappingDialog
Résultat SIL.FieldWorks.TE.CharacterMappingSettings

m_lvCurrentMappingList protected_oe property

Either lvScrMappings or lvAnnotationMappings
protected FwListView,SIL.FieldWorks.Common.Controls m_lvCurrentMappingList
Résultat SIL.FieldWorks.Common.Controls.FwListView

m_projectType protected_oe property

protected ProjectTypes m_projectType
Résultat ProjectTypes

m_scr protected_oe property

protected IScripture m_scr
Résultat IScripture

m_settings protected_oe property

current import settings retrieved from/stored in Scripture.
protected IScrImportSet m_settings
Résultat IScrImportSet

rbOther protected_oe property

Protected for Tests
protected RadioButton,System.Windows.Forms rbOther
Résultat System.Windows.Forms.RadioButton

rbParatext5 protected_oe property

Protected for Tests
protected RadioButton,System.Windows.Forms rbParatext5
Résultat System.Windows.Forms.RadioButton

rbParatext6 protected_oe property

Protected for Tests
protected RadioButton,System.Windows.Forms rbParatext6
Résultat System.Windows.Forms.RadioButton

sfFileListBuilder protected_oe property

Protected for Tests
protected SFFileListBuilder,SIL.FieldWorks.Common.Controls sfFileListBuilder
Résultat SIL.FieldWorks.Common.Controls.SFFileListBuilder