コード例 #1
0
ファイル: EngineDebug.cs プロジェクト: akrisiun/git-dot-aspx
        public static void ListRoutes(HttpResponse Response)
        {
            RouteCollection        routes = RouteTable.Routes;
            Collection <RouteBase> List   = routes;

            var table = new XElement("table", new XElement("tr"
                                                           , new XElement("th", "Route.Defaults")
                                                           , new XElement("th", "Route.Url")
                                                           ));

            table.Add(List.Select(item => new XElement("tr"
                                                       , new XElement("td", item is Route ? ParseDefaults((item as Route).Defaults) : "-")
                                                       , new XElement("td", ObjectConvert.GetValue <string>(item, "Url"))
                                                       )));
            Response.Write(new XElement("br"));
            table.Save(Response.OutputStream);
        }