コード例 #1
0
        private static void GetLinkBox(Control linkBox, string title,
                                       IEnumerable <LinkInfo> links)
        {
            new HtmlDiv {
                InnerText = title
            }.AddTo(linkBox, "link-header");
            var div = new HtmlDiv().AddTo(linkBox, "links");

            ForResearchPage.AddLinksToLinkBox(div, links);
        }
コード例 #2
0
        private static void AddUpcomingLinksToDiv(Control div,
                                                  string stateCode)
        {
            var links = GetUpcomingLinks(stateCode);

            if (links.Count > 0)
            {
                ForResearchPage.AddLinksToLinkBox(div, links);
            }
            else
            {
                var p       = new HtmlP().AddTo(div);
                var message =
                    $"No {StateCache.GetStateName(stateCode)} upcoming election reports are available. " +
                    "Please check back later.";
                new LiteralControl(message).AddTo(p);
            }
        }