コード例 #1
0
            public string GetMappedUrl(string hostname, string relativePath)
            {
                string result;

                if (RelativeLinks.TryGetValue(relativePath, out result))
                {
                    return(result);
                }

                Dictionary <string, string> hostnameBindings;

                if (RelativeLinksPerHostname.TryGetValue(hostname, out hostnameBindings) &&
                    hostnameBindings.TryGetValue(relativePath, out result))
                {
                    return(result);
                }

                return(null);
            }
コード例 #2
0
        protected override List <HtmlTableRow> GetRelativeRows()
        {
            List <HtmlTableRow> rows = new List <HtmlTableRow>();

            foreach (var item in RelativeLinks.Take(5))
            {
                HtmlTableRow  row  = new HtmlTableRow();
                HtmlTableCell cell = new HtmlTableCell();
                cell.Attributes["class"] = "linkCell";
                HtmlAnchor anchor = new HtmlAnchor();
                anchor.InnerText = item.Name;
                anchor.HRef      = item.Url;
                anchor.Title     = item.Description;
                anchor.Target    = string.IsNullOrEmpty(LinkTarget) ? "_blank" : LinkTarget;
                cell.Controls.Add(anchor);
                row.Controls.Add(cell);
                rows.Add(row);
            }
            return(rows);
        }