Beispiel #1
0
        private void BuildRenderings(string strProjectFolder, string termId)
        {
            termRenderingsList = new List <TermRendering>();
            int projectNum = 0;

            for (int i = 0; i < scrTextNames.Count; i++)
            {
                string name = scrTextNames[i];

                /* until we have a "TermRenderingsList" xml file for this project, we can't use this feature
                 * the BiblicalTermsEn.xml in the BiblicalTerms folder is *not* one of these and won't work.
                 * string strPath = strProjectFolder;
                 * if (i > 0)
                 *      strPath = BiblicalTermsList.DefaultBiblicalTermsFileFolder;
                 */
                TermRenderingsList termRenderings = TermRenderingsList.GetTermRenderings(strProjectFolder, name);
                TermRendering      termRendering  = termRenderings.GetRendering(termId);
                termRenderingsList.Add(termRendering);

                string val = termRendering.Renderings;
                val += FormattedNotes(termRendering);

                projectVariablesList[projectNum]["Renderings"] = val;

                ++projectNum;
            }
        }
        public void Show(AnchorsData theAnchors, StoryProjectData theStoryProject)
        {
            Show();
            Cursor curCursor = Cursor;

            Cursor = Cursors.WaitCursor;

            try
            {
#if DEBUG
                // Test the Sword names vs. the names used by Paratext
                foreach (string str in AnchorData.mapSwordToParatextBookCodes.Values)
                {
                    VerseRef verser = new VerseRef(str + " 1:1");
                }
                foreach (string str in AnchorData.mapSwordToParatextBookCodes.Keys)
                {
                    string     strAnchor  = str + " 1:1";
                    AnchorData anchorData = new AnchorData(strAnchor, strAnchor);
                    VerseRef   verser     = new VerseRef(anchorData.AnchorAsVerseRef);
                }
#endif

                List <string> lstRefs = new List <string>();
                foreach (AnchorData anAnchor in theAnchors)
                {
                    VerseRef verseRef = new VerseRef(anAnchor.AnchorAsVerseRef);
                    lstRefs.Add(verseRef.BBBCCCVVV());
                }

                visibleTerms.Clear();
                progressBarLoadingKeyTerms.Maximum = _biblicalTerms.Terms.Count;
                progressBarLoadingKeyTerms.Value   = 0;
                foreach (Term term in _biblicalTerms.Terms)
                {
                    foreach (Verse aVerseReference in term.References)
                    {
                        if (lstRefs.Contains(aVerseReference.VerseRef.BBBCCCVVV()))
                        {
                            visibleTerms.Add(term);
                            break;
                        }
                    }
                    progressBarLoadingKeyTerms.Value++;
                }

                // indicate that we've checked the key terms here.
                theAnchors.IsKeyTermChecked = true;

                if (visibleTerms.Count == 0)
                {
                    MessageBox.Show(Localizer.Str("There are no Biblical Terms in this verse(s)."));
                    return;
                }

                renderings        = TermRenderingsList.GetTermRenderings(_projSettings.ProjectFolder, MainLang.LangCode);
                termLocalizations = TermLocalizations.Localizations;

                ColumnTermLemma.DefaultCellStyle.Font       = new Font("Charis SIL", 12);
                ColumnStatus.DefaultCellStyle.Font          = new Font("Wingdings", 11);
                ColumnRenderings.DefaultCellStyle.Font      = MainLang.FontToUse;
                ColumnRenderings.DefaultCellStyle.ForeColor = MainLang.FontColor;

                termIndexRequested = -1;
                LoadTermsList();
            }
            catch (Exception ex)
            {
                MessageBox.Show(String.Format(Properties.Resources.IDS_KeyTermsProblem,
                                              Environment.NewLine, ex.Message), Properties.Resources.IDS_Caption);
                return;
            }
            finally
            {
                Cursor = curCursor;
            }
        }