Beispiel #1
0
        /// <summary>
        /// Start a hyperlink to the destination indicated.
        /// </summary>
        /// <param name="tgt"></param>
        /// <param name="web"></param>
        protected override void StartLink(string tgt, string web)
        {
            string chapterFormat = "00";
            string theLink;

            if (tgt.Length > 0)
            {
                BCVInfo bcvRec = bookInfo.ValidateInternalReference(tgt);
                if (bcvRec.exists)
                {
                    if (bcvRec.bkInfo.tla.CompareTo("PSA") == 0)
                    {
                        chapterFormat = "000";
                    }
                    theLink = String.Format("<a href='{0}{1}.htm#V{2}'>", bcvRec.bkInfo.tla, bcvRec.chapInfo.chapterInteger.ToString(chapterFormat),
                                            bcvRec.vsInfo.startVerse.ToString());
                    if (inFootnote)
                    {
                        footnotesToWrite.Append(theLink);
                    }
                    else
                    {
                        WriteHtml(theLink);
                    }
                    inLink = true;
                }
            }
            else if (web.Length > 0)
            {
                inLink  = true;
                theLink = String.Format("<a href=\"{0}\">", web);
                if (inFootnote)
                {
                    footnotesToWrite.Append(theLink);
                }
                else
                {
                    htm.Write(theLink);
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Start a hyperlink to the destination indicated.
        /// </summary>
        /// <param name="tgt"></param>
        /// <param name="web"></param>
        protected override void StartLink(string tgt, string web)
        {
            string theLink;

            if (tgt.Length > 0)
            {
                BCVInfo bcvRec = bookInfo.ValidateInternalReference(tgt);
                if (bcvRec.exists)
                {
                    string s = String.Format("<span class='bibleref' data-id='{0}{1}_{2}'>",
                                             bcvRec.bkInfo.shortCode,
                                             bcvRec.chapInfo.chapterInteger.ToString(),
                                             bcvRec.vsInfo.startVerse.ToString());
                    if (inFootnote)
                    {
                        footnotesToWrite.Append(s);
                    }
                    else
                    {
                        WriteHtml(s);
                    }
                    inLink = true;
                }
            }
            else if (web.Length > 0)
            {
                inLink  = true;
                theLink = String.Format("<a href=\"{0}\">", web);
                if (inFootnote)
                {
                    footnotesToWrite.Append(theLink);
                }
                else
                {
                    htm.Write(theLink);
                }
            }
        }