Пример #1
0
        /// <summary>
        /// Build the HTML text for a list of references.
        /// </summary>
        /// <param name="references">verses to show in list</param>
        /// <param name="termId">Biblical Term</param>
        /// <param name="status">summary status over all references</param>
        /// <returns>html for references</returns>
        public string Build(
            StoryEditor theSE,
            string termId,
            string strProjectFolder,
            ProgressBar progressBarLoadingKeyTerms,
            out BiblicalTermStatus status)
        {
            BuildRenderings(strProjectFolder, termId);

            builder.Clear();

            // Output the per project stylesheet info
            for (int i = 0; i < projectVariablesList.Count; ++i)
            {
                builder.SetDictionary(projectVariablesList[i]);
                if (i == 0)
                {
                    builder.Output("a");
                }
                builder.Output("b");
            }

            builder.Output("c");

            // builder.Output the table header info
            for (int i = 0; i < projectVariablesList.Count; ++i)
            {
                builder.SetDictionary(projectVariablesList[i]);
                builder.Output("d");
            }

            builder.Output("e");

            status = BiblicalTermStatus.AllFound;

            //For each reference output a cell for each project
            progressBarLoadingKeyTerms.Maximum = mapReferenceToVerseTextList.Keys.Count;
            progressBarLoadingKeyTerms.Value   = 0;

            foreach (string strVerseReference in mapReferenceToVerseTextList.Keys)
            {
                for (int projectNum = 0; projectNum < projectVariablesList.Count; ++projectNum)
                {
                    builder.SetDictionary(projectVariablesList[projectNum]);

                    bool renderingFound;
                    bool renderingDenied;
                    setupReferenceVars(theSE, projectNum, strVerseReference,
                                       out renderingFound, out renderingDenied);
                    builder.SetDictionary(referenceVariables);

                    // Decide whether to show this reference depending on whether
                    // a rendering was found/denied for the first project and the view settings.
                    if (projectNum == 0)
                    {
                        // status is cumulative over all references
                        status = UpdateStatus(status, renderingFound, renderingDenied);

                        builder.Output("f");
                    }

                    builder.Output("g");
                }

                builder.Output("h");

                progressBarLoadingKeyTerms.Value++;
            }

            builder.Output("i");

            builder.Output("j");
            return(builder.ToString());
        }