Exemplo n.º 1
0
        protected override void RenderContents(HtmlTextWriter output)
        {
            string strLeftHtml   = "";
            string strRightHtml  = "";
            string strTopHtml    = "";
            string strBottomHtml = "";

            GetCustomHtml(out strLeftHtml, out strRightHtml, out strTopHtml, out strBottomHtml);

            int nParentCount = GetParentCount();

            output.Indent += nParentCount;

            // 主体内容结束
            NormalIndentor.Write(output, -1);
            output.Write("<!-- FooterBarControl 开始 -->");

            EndIndentor.Write(output);
            output.Write("</td></tr>");

            // 底部图像表格 开始

            NormalIndentor.Write(output);
            output.Write("<!-- 底部图像开始 -->");

            BeginIndentor.Write(output);
            output.Write("<tr><td>");

            BeginIndentor.Write(output);
            output.Write("<table class='footer'>");

            BeginIndentor.Write(output);
            output.Write("<tr class='footer'>");

            // 左
            NormalIndentor.Write(output);
            output.Write("<td class='left'>" + strLeftHtml + "</td>");

            // 中
            NormalIndentor.Write(output);
#if NO
            output.Write("<td class='middle'>"
                         + this.GetString("dp2图书馆集成系统")
                         + " V2 - " + this.GetString("版权所有") + " © 2006-2015 <a href='http://dp2003.com'>"
                         + this.GetString("数字平台(北京)软件有限责任公司")
                         + "</a>"
                         + "</td>");
#endif
            OpacApplication app = (OpacApplication)this.Page.Application["app"];

            output.Write("<td class='middle'>"
                         + strTopHtml
                         + this.GetString("dp2图书馆集成系统")
                         + " V3 - <a href='https://github.com/DigitalPlatform/dp2'>"
                         + "开源的图书馆管理系统"
                         + strBottomHtml
                         + "</td>");

            // 右
            NormalIndentor.Write(output);
            output.Write("<td class='right'>" + strRightHtml + "</td>");

            EndIndentor.Write(output);
            output.Write("</tr>");
            EndIndentor.Write(output);
            output.Write("</table>");

            EndIndentor.Write(output);
            output.Write("</td></tr>");
            NormalIndentor.Write(output);
            output.Write("<!-- 底部图像结束 -->");

            // 总表格结束
            EndIndentor.Write(output);
            output.Write("</table>");
            NormalIndentor.Write(output);
            output.Write("<!-- FooterBarControl 结束 -->");

            if (string.IsNullOrEmpty(app.OutgoingQueue) == false)
            {
                output.Write("<center><br/><br/><div><img src='" + MyWebPage.GetStylePath(app, "qrcode_ilovelibrary_258.jpg") + "'></img><br/><br/>用微信“扫一扫”,关注“我爱图书馆”公众号,可获得超期、借书还书等微信消息通知<br/><br/><br/><br/></div></center>");
            }

            output.Indent -= nParentCount;
        }
Exemplo n.º 2
0
        protected override void Render(HtmlTextWriter writer)
        {
            string strText = this.Text;

            for (; ;)
            {
                int nRet = strText.IndexOf("<%");
                if (nRet == -1)
                {
                    writer.Write(strText);
                    break;
                }

                if (nRet > 0)
                {
                    writer.Write(strText.Substring(0, nRet));
                    strText = strText.Substring(nRet);
                }

                if (strText.Length == 0)
                {
                    break;
                }

                if (strText.Length >= "<%begin%>".Length)
                {
                    string strTemp = strText.Substring(0, "<%begin%>".Length);
                    if (strTemp == "<%begin%>")
                    {
                        BeginIndentor.Write(writer);
                        strText = strText.Substring("<%begin%>".Length);
                        continue;
                    }
                }

                if (strText.Length >= "<%end%>".Length)
                {
                    string strTemp = strText.Substring(0, "<%end%>".Length);
                    if (strTemp == "<%end%>")
                    {
                        EndIndentor.Write(writer);
                        strText = strText.Substring("<%end%>".Length);
                        continue;
                    }
                }

                if (strText.Length >= "<%normal%>".Length)
                {
                    string strTemp = strText.Substring(0, "<%normal%>".Length);
                    if (strTemp == "<%normal%>")
                    {
                        NormalIndentor.Write(writer);
                        strText = strText.Substring("<%normal%>".Length);
                        continue;
                    }
                }

                if (strText.Length >= "<%normal(1)%>".Length)
                {
                    string strTemp = strText.Substring(0, "<%normal(1)%>".Length);
                    if (strTemp == "<%normal(1)%>")
                    {
                        NormalIndentor.Write(writer, 1);
                        strText = strText.Substring("<%normal(1)%>".Length);
                        continue;
                    }
                }

                nRet = strText.IndexOf("%>", 2);
                if (nRet == -1)
                {
                    writer.Write(strText);
                    break;
                }

                writer.Write(strText.Substring(0, nRet + 2));

                strText = strText.Substring(nRet + 2);
            }

            base.Render(writer);
        }