当前位置: 首页>>代码示例>>C#>>正文


C# IUrlRegistry.UrlFor方法代码示例

本文整理汇总了C#中IUrlRegistry.UrlFor方法的典型用法代码示例。如果您正苦于以下问题:C# IUrlRegistry.UrlFor方法的具体用法?C# IUrlRegistry.UrlFor怎么用?C# IUrlRegistry.UrlFor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IUrlRegistry的用法示例。


在下文中一共展示了IUrlRegistry.UrlFor方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RequestLinksTag

        public RequestLinksTag(RequestLog log, IUrlRegistry urls)
        {
            AddHeader("Chain Details");

            Add("li").Add("a").Id("chain-summary").Attr("href", "#").Text("View Summary");
            Add("li").Add("span/a").Attr("href", urls.UrlFor(new ChainDetailsRequest{Id = log.ChainId})).Text("View Details").AddClass("external").Attr("target", "_blank");
        }
开发者ID:DarthFubuMVC,项目名称:FubuMVC.Diagnostics,代码行数:7,代码来源:RequestLinksTag.cs

示例2: DiagnosticMenuTag

        public DiagnosticMenuTag(IDiagnosticContext context, ICurrentHttpRequest currentHttpRequest, IUrlRegistry urls) : base("ul")
        {
            AddClass("nav");

            var group = context.CurrentGroup();

            var index = group.Index();
            if (index != null)
            {
                addLink(index, context, currentHttpRequest);
            }
            else
            {
                var url = urls.UrlFor(new GroupRequest {Name = group.Name});
                var li = Add("li");
                li.Add("a").Attr("href", url).Text(group.Name).Attr("title", group.Description);

                if (context.CurrentChain() == null)
                {
                    li.AddClass("active");
                }
            }

            group.Links().Each(x => addLink(x, context, currentHttpRequest));
        }
开发者ID:DarthFubuMVC,项目名称:FubuMVC.Diagnostics,代码行数:25,代码来源:FubuPageExtensions.cs

示例3: writeLog

 private void writeLog(RequestLog log, IUrlRegistry urls)
 {
     AddBodyRow(row => {
         var chainUrl = urls.UrlFor(log);
         row.Cell().Add("a").Text(log.LocalTime).Attr("href", chainUrl);
         row.Cell(log.Endpoint);
         row.Cell(log.HttpMethod);
         var statusCell = row.Cell();
         statusCell.Add("span").AddClass("http-status-code").Text(log.HttpStatus.Status.ToString());
         statusCell.Add("span").AddClass("http-status-description").Text(log.HttpStatus.Description);
         
         row.Cell(log.ContentType);
         row.Cell(Math.Ceiling(log.ExecutionTime).ToString()).AddClass("number");
     });
 }
开发者ID:DarthFubuMVC,项目名称:FubuMVC.Diagnostics,代码行数:15,代码来源:RequestTable.cs

示例4: BuildDocument

        public static HtmlDocument BuildDocument(IUrlRegistry urls, string title, params HtmlTag[] tags)
        {
            var css = GetResourceText(typeof(BehaviorGraphWriter), "diagnostics.css");

            var realTitle = "FubuMVC: " + title;

            var document = new HtmlDocument();
            document.Title = realTitle;

            var mainDiv = new HtmlTag("div").AddClass("main");
            mainDiv.Add("h2").Text("FubuMVC Diagnostics").Child(buildVersionTag());
            var navBar = mainDiv.Add("div").AddClass("homelink");
            navBar.AddChildren(new LinkTag("Home", urls.UrlFor<BehaviorGraphWriter>(w => w.Index())));
            navBar.Add("span").Text(" > " + title);
            document.Add(mainDiv);

            mainDiv.AddChildren(tags);

            document.AddStyle(css);

            return document;
        }
开发者ID:joshuaflanagan,项目名称:fubumvc,代码行数:22,代码来源:DiagnosticHtml.cs

示例5: BuildDocument

        public static HtmlDocument BuildDocument(IUrlRegistry urls, string title, params HtmlTag[] tags)
        {
            string css = GetDiagnosticCss();

            var realTitle = "FubuMVC: " + title;

            var document = new HtmlDocument();
            document.Title = realTitle;

            var mainDiv = new HtmlTag("div").AddClass("main");
            mainDiv.Add("h2").Text("FubuMVC Diagnostics").Append(buildVersionTag());
            var navBar = mainDiv.Add("div").AddClass("homelink");
            if (urls != null) navBar.Append(new LinkTag("Home", urls.UrlFor<BehaviorGraphWriter>(w => w.Index(), null)));
            navBar.Add("span").Text(" > " + title);
            document.Add(mainDiv);

            mainDiv.Append(tags);

            document.AddStyle(css);

            return document;
        }
开发者ID:jemacom,项目名称:fubumvc,代码行数:22,代码来源:DiagnosticHtml.cs

示例6: addJobRow

        private void addJobRow(TableRowTag row, JobStatusDTO job, IUrlRegistry urls)
        {
            row.Cell().Add("a").Text(job.JobKey).Attr("href", urls.UrlFor(new ScheduledJobRequest{Job = job.JobKey}));
            row.Cell(job.NextTime.HasValue ? job.NextTime.Value.ToLocalTime().ToString() : "Not scheduled");
            row.Cell(job.GetStatusDescription());
            row.Cell(job.GetLastExecutionDescription());

            var url = urls.UrlFor(new RunJobRequest {Name = job.JobKey});

            row.Cell().Add("button").Text("Execute").Attr("data-url", url).AddClass("button").AddClass("executor").Attr("onclick", "if (window.confirm('Ok to run this job?')) window.location='" + url + "'");
        }
开发者ID:RyanHauert,项目名称:FubuTransportation,代码行数:11,代码来源:ScheduledJobsFubuDiagnostics.cs

示例7: addQueueRow

        private void addQueueRow(TableRowTag row, IQueueManager queueManager, string queueName, IUrlRegistry urls, string displayForCount = null)
        {
            var url = urls.UrlFor(new MessagesInputModel {Port = queueManager.Endpoint.Port, QueueName = queueName});

            row.Cell().Add("a")
                .Attr("href", url)
                .Text(queueName);

            row.Cell(displayForCount ?? queueManager.GetNumberOfMessages(queueName).ToString(CultureInfo.InvariantCulture));
        }
开发者ID:joemcbride,项目名称:fubumvc,代码行数:10,代码来源:LightningQueuesFubuDiagnostics.cs

示例8: ForChain

 public static RouteReport ForChain(BehaviorChain chain, IUrlRegistry urls)
 {
     return new RouteReport(chain, urls.UrlFor(new ChainRequest{Id = chain.UniqueId}), urls.UrlFor(new ChainDetailsRequest{Id = chain.UniqueId}));
 }
开发者ID:kharlamov,项目名称:FubuMVC.Diagnostics,代码行数:4,代码来源:RouteReport.cs


注:本文中的IUrlRegistry.UrlFor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。