コード例 #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initializes the scripture project.
        /// </summary>
        /// <param name="progressDialog">The progress dialog.</param>
        /// <param name="parameters">The parameters.</param>
        /// <returns></returns>
        /// ------------------------------------------------------------------------------------
        private object InitializeScriptureProject(IThreadedProgress progressDialog, object[] parameters)
        {
            ILangProject lp = m_cache.LanguageProject;

            if (m_scr == null)
            {
                InitializeScriptureAndStyles(progressDialog);
            }

            // REVIEW: Since all the version-based initialization will be taken care of by a
            // subsequent call to EnsureProjectComponentsValid, we could probably get rid of this and/or
            // put it in the above block as we do with the stylesheet initialization.

            //Initialize factory publications
            if (m_scr.PublicationsOC.Count == 0)
            {
                TePublicationsInit.CreatePublicationInfo(progressDialog, m_scr);
            }

            //Initialize the key terms
            ICmPossibilityList keyTermsList = lp.KeyTermsList;

            if (keyTermsList.PossibilitiesOS.Count < 1)
            {
                TeKeyTermsInit.CreateKeyTerms(progressDialog, keyTermsList, m_app);
            }

            //Initialize the annotation categories
            if (m_scr.NoteCategoriesOA == null || m_scr.NoteCategoriesOA.PossibilitiesOS.Count == 0)
            {
                TeScrNoteCategoriesInit.CreateFactoryScrNoteCategories(progressDialog, m_scr);
            }

            // For good measure, on the off-chance the user notices.
            progressDialog.Position = progressDialog.Maximum;

            return(null);
        }
コード例 #2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initializes the scripture project.
        /// </summary>
        /// <param name="progressDialog">The progress dialog.</param>
        /// <param name="parameters">The parameters.</param>
        /// <returns></returns>
        /// ------------------------------------------------------------------------------------
        private object InitializeScriptureProject(IAdvInd4 progressDialog, params object[] parameters)
        {
            ILangProject lp = m_cache.LangProject;

            if (m_scr == null)
            {
                m_scr = lp.TranslatedScriptureOA = new Scripture();

                //Initialize factory styles
                TeStylesXmlAccessor.CreateFactoryScrStyles(progressDialog, m_scr);

                // Initialize the separator and bridge strings.
                m_scr.ChapterVerseSepr = ":";
                m_scr.Bridge           = "-";
                m_scr.RefSepr          = ";";
                m_scr.VerseSepr        = ",";

                //Initialize misc
                m_scr.RestartFootnoteSequence        = true;
                m_scr.CrossRefsCombinedWithFootnotes = false;

                m_scr.FootnoteMarkerType       = FootnoteMarkerTypes.AutoFootnoteMarker;
                m_scr.FootnoteMarkerSymbol     = Scripture.kDefaultFootnoteMarkerSymbol;
                m_scr.DisplayFootnoteReference = false;

                m_scr.CrossRefMarkerType       = FootnoteMarkerTypes.NoFootnoteMarker;
                m_scr.CrossRefMarkerSymbol     = Scripture.kDefaultFootnoteMarkerSymbol;
                m_scr.DisplayCrossRefReference = true;
            }

            // Initialize Scripture book annotations
            if (m_scr.BookAnnotationsOS.Count == 0)
            {
                CreateScrBookAnnotations();
            }

            //Initialize Scripture Book Ref info
            if (m_cache.ScriptureReferenceSystem.BooksOS.Count == 0)
            {
                CreateScrBookRefs(progressDialog);
            }

            //Initialize factory publications
            if (m_scr.PublicationsOC.Count == 0)
            {
                TePublicationsInit.CreatePublicationInfo(progressDialog, m_scr);
            }

            //Initialize the key terms
            ICmPossibilityList keyTermsList = lp.KeyTermsList;

            if (keyTermsList.PossibilitiesOS.Count < 1)
            {
                TeKeyTermsInit.CreateKeyTerms(progressDialog, keyTermsList);
            }

            //Initialize the note categories
            if (m_scr.NoteCategoriesOA == null || m_scr.NoteCategoriesOA.PossibilitiesOS.Count == 0)
            {
                TeScrNoteCategoriesInit.CreateFactoryScrNoteCategories(progressDialog, m_scr);
            }

            m_cache.Save();

            // For good measure, on the off-chance the user notices.
            int nMin, nMax;

            progressDialog.GetRange(out nMin, out nMax);
            progressDialog.Position = nMax;

            return(null);
        }