Ejemplo n.º 1
0
 public void Add(PageNumLogic logic)
 {
     if (logic != null)
     {
         _logics.Add(logic);
     }
 }
Ejemplo n.º 2
0
        private void createAnchorElement(StringBuilder sb, string url, PageNumLogic logic, int newPage, string label, string hint, IEnumerable <PageNumLogic> others)
        {
            sb.Append("<a href=\"");
            sb.Append(url);
            sb.Append('?');
            foreach (KeyValuePair <string, string> entry in _params)
            {
                sb.Append(WebUtility.HtmlEncode(entry.Key));
                sb.Append('=');
                sb.Append(WebUtility.HtmlEncode(entry.Value));
                sb.Append('&');
            }

            sb.Append(WebUtility.HtmlEncode(logic.Param));
            sb.Append('=');
            sb.Append($"{newPage}");
            foreach (var o in others)
            {
                if (o.CurrentPage != -1)
                {
                    sb.Append("&");
                    sb.Append(WebUtility.HtmlEncode(o.Param));
                    sb.Append('=');
                    sb.Append($"{o.CurrentPage}");
                }
            }
            sb.Append("\">");
            if (!string.IsNullOrWhiteSpace(hint))
            {
                sb.Append("<div class=\"SGHasTooltip\">");
            }
            sb.Append(WebUtility.HtmlEncode(label));
            if (!string.IsNullOrWhiteSpace(hint))
            {
                sb.Append($"<div class=\"SGTooltipText\">{WebUtility.HtmlEncode(hint.Trim())}</div></div>");
            }

            sb.Append("</a>");
        }