/// ------------------------------------------------------------------------------------ /// <summary> /// Constructor for runtime. /// </summary> /// <param name="langProjName">Name of the lang proj.</param> /// <param name="scr">The Scripture object.</param> /// <param name="styleSheet">The styleSheet</param> /// <param name="helpTopicProvider">The help topic provider.</param> /// <param name="app">The app.</param> /// ------------------------------------------------------------------------------------ public ImportWizard(string langProjName, IScripture scr, FwStyleSheet styleSheet, IHelpTopicProvider helpTopicProvider, IApp app) : this() { m_LangProjName = langProjName; m_scr = scr; m_helpTopicProvider = helpTopicProvider; m_app = app; m_StyleSheet = styleSheet; m_resolver = new ConfirmOverlappingFileReplaceDialog(helpTopicProvider); m_cache = scr.Cache; // Attempt to get the default import settings. m_settings = m_scr.FindOrCreateDefaultImportSettings(TypeOfImport.Unknown); if (m_settings.ImportTypeEnum == TypeOfImport.Unknown) m_settings.ImportTypeEnum = TypeOfImport.Paratext6; InitializeScrImportSettings(); // Initialize controls based on settings provided switch (m_settings.ImportTypeEnum) { case TypeOfImport.Paratext6: rbParatext6.Checked = true; break; case TypeOfImport.Other: rbOther.Checked = true; break; case TypeOfImport.Paratext5: rbParatext5.Checked = true; break; } if (m_helpTopicProvider == null) m_btnHelp.Visible = false; if (m_app != null) { m_LatestImportFolder = new RegistryStringSetting(FwSubKey.TE, m_scr.Cache.ProjectId.Name, "LatestImportDirectory", string.Empty); sfFileListBuilder.LatestImportFolder = m_LatestImportFolder.Value; } sfFileListBuilder.Initialize(m_helpTopicProvider, m_app); if (m_StyleSheet != null) { m_scrViewHelper = new StyleListViewHelper(lvScrMappings, 1); m_scrViewHelper.AddStyles(m_StyleSheet, MappingDetailsCtrl.AllPseudoStyles); m_annotationViewHelper = new StyleListViewHelper(lvAnnotationMappings, 1); m_annotationViewHelper.AddStyles(m_StyleSheet, MappingDetailsCtrl.AllPseudoStyles); } }
/// ------------------------------------------------------------------------------------ /// <summary> /// Constructor for runtime. /// </summary> /// <param name="langProjName">Name of the lang proj.</param> /// <param name="scr">The Scripture object.</param> /// <param name="styleSheet">The styleSheet</param> /// <param name="cache">The cache</param> /// <param name="sHelpFile">If null, the help button will be hidden</param> /// ------------------------------------------------------------------------------------ public ImportWizard(string langProjName, Scripture scr, FwStyleSheet styleSheet, FdoCache cache, string sHelpFile) : this() { m_LangProjName = langProjName; m_scr = scr; m_StyleSheet = styleSheet; m_resolver = new ConfirmOverlappingFileReplaceDialog(); m_settings = (ScrImportSet)m_scr.DefaultImportSettings; if (m_settings == null) { m_settings = new ScrImportSet(); m_scr.ImportSettingsOC.Add(m_settings); m_settings.ImportTypeEnum = TypeOfImport.Paratext6; } InitializeScrImportSettings(); // Initialize controls based on settings provided switch (m_settings.ImportTypeEnum) { case TypeOfImport.Paratext6: rbParatext6.Checked = true; break; case TypeOfImport.Other: rbOther.Checked = true; break; case TypeOfImport.Paratext5: rbParatext5.Checked = true; break; } m_cache = cache; m_helpFile = sHelpFile; if (m_helpFile == null) m_btnHelp.Visible = false; if (FwApp.App != null) { m_LatestImportFolder = new RegistryStringSetting(FwSubKey.TE, cache.ServerName, cache.DatabaseName, "LatestImportDirectory", string.Empty); sfFileListBuilder.LatestImportFolder = m_LatestImportFolder.Value; } if (m_StyleSheet != null) { m_scrViewHelper = new StyleListViewHelper(lvScrMappings, 1); m_scrViewHelper.AddStyles(m_StyleSheet as FwStyleSheet, MappingDetailsCtrl.AllPseudoStyles); m_annotationViewHelper = new StyleListViewHelper(lvAnnotationMappings, 1); m_annotationViewHelper.AddStyles(m_StyleSheet as FwStyleSheet, MappingDetailsCtrl.AllPseudoStyles); } }