/// ----------------------------------------------------------------------------------- /// <summary> /// Preloads all the data needed by TE and checks to make sure that the information /// that TE needs to run (styles, Key terms, etc.) is up to date. /// </summary> /// <param name="cache">FDO cache for accessing DB</param> /// <param name="fOpeningNewProject"><c>true</c> if opening a brand spankin' new /// project</param> /// <returns>true if data loaded successfully; false, otherwise</returns> /// ----------------------------------------------------------------------------------- protected bool LoadData(FdoCache cache, bool fOpeningNewProject) { // Load the Scripture Books //LangProject lp = cache.LangProject; // Temporary code.... Uncomment this line if the only thing you need to do is // reload the styles list. // TeStylesXmlAccessor.CreateFactoryScrStyles(lp.TranslatedScriptureOA, null); // temporary code to blow away the user views for TE // foreach (UserView view in cache.UserViewSpecs.GetUserViews(TeApp.AppGuid)) // { // cache.DeleteObject(view.Hvo); // } // Temporary code.... Remove after PHM, JAS, and JUD are imported into TestLangProj // lp.TranslatedScriptureOA.DefaultImportSettings = null; // Temporary code.... Remove after New Styles are created // lp.TranslatedScriptureOA = null; if (!TeScrInitializer.Initialize(cache, m_SplashScreenWnd)) { return(false); } ScriptureChangeWatcher.Create(cache); return(true); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Perform one-time initialization of a new Scripture project /// </summary> /// <param name="cache">The database cache</param> /// <param name="app">The TE application.</param> /// <param name="progressDlg">The progress dialog (can be null).</param> /// <returns> /// true if data loaded successfully; false, otherwise /// </returns> /// ------------------------------------------------------------------------------------ public static bool Initialize(FdoCache cache, FwApp app, IThreadedProgress progressDlg) { TeScrInitializer scrInitializer = new TeScrInitializer(cache); scrInitializer.m_app = app; return scrInitializer.Initialize(progressDlg); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Perform one-time initialization of a new Scripture project /// </summary> /// <param name="cache">The database cache</param> /// <param name="app">The TE application.</param> /// <param name="progressDlg">The progress dialog (can be null).</param> /// <returns> /// true if data loaded successfully; false, otherwise /// </returns> /// ------------------------------------------------------------------------------------ public static bool Initialize(FdoCache cache, FwApp app, IThreadedProgress progressDlg) { TeScrInitializer scrInitializer = new TeScrInitializer(cache); scrInitializer.m_app = app; return(scrInitializer.Initialize(progressDlg)); }
/// ------------------------------------------------------------------------------------ /// <summary> /// App-specific initialization of the cache. /// </summary> /// <param name="progressDlg">The progress dialog.</param> /// <returns>True if the initialize was successful, false otherwise</returns> /// ------------------------------------------------------------------------------------ public override bool InitCacheForApp(IThreadedProgress progressDlg) { if (!TeScrInitializer.Initialize(Cache, this, progressDlg)) { return(false); } // Make sure this DB uses the current stylesheet version, note categories & and key terms list IActionHandler actionHandler = Cache.ServiceLocator.GetInstance <IActionHandler>(); NonUndoableUnitOfWorkHelper.DoUsingNewOrCurrentUOW(actionHandler, () => TeScrInitializer.EnsureProjectComponentsValid(Cache, this, progressDlg)); Cache.ServiceLocator.GetInstance <IParagraphCounterRepository>().RegisterViewTypeId <TeParaCounter>((int)TeViewGroup.Scripture); Cache.ServiceLocator.GetInstance <IParagraphCounterRepository>().RegisterViewTypeId <TeParaCounter>((int)TeViewGroup.Footnote); return(true); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Perform one-time initialization of a new Scripture project /// </summary> /// <param name="cache">The database cache</param> /// <param name="splashScreen">The splash screen (can be null).</param> /// <returns> /// true if data loaded successfully; false, otherwise /// </returns> /// ------------------------------------------------------------------------------------ public static bool Initialize(FdoCache cache, IFwSplashScreen splashScreen) { TeScrInitializer scrInitializer = new TeScrInitializer(cache); return scrInitializer.Initialize(splashScreen); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Perform one-time initialization of a new Scripture project /// </summary> /// <param name="cache">The database cache</param> /// <param name="splashScreen">The splash screen (can be null).</param> /// <returns> /// true if data loaded successfully; false, otherwise /// </returns> /// ------------------------------------------------------------------------------------ public static bool Initialize(FdoCache cache, IFwSplashScreen splashScreen) { TeScrInitializer scrInitializer = new TeScrInitializer(cache); return(scrInitializer.Initialize(splashScreen)); }