Пример #1
0
        public HtmlDocument QueryScripts(ScriptQuery query)
        {
            var queryNames = query.Scripts == null
                                                 ? new string[0]
                                                 : query.Scripts.Split(',').Select(x => x.Trim()).Distinct();

            var document = DiagnosticHtml.BuildDocument(_urls, "Script Graph Query");
            document.Push("div").AddClass("script-query");

            document.Push("form").Attr("action", _urls.UrlFor<ScriptWriter>(x => x.QueryScripts(null)));

            document.Add("b").Text("For requested script names (comma-delimited):  ");
            document.Add(new TextboxTag("Scripts", queryNames.Join(", ")).Id("script-names-text"));
            document.Add("br");
            document.Add("input").Attr("type", "submit").Value("Query");
            document.Pop();

            if (queryNames.Any())
            {
                document.Add("hr");
                document.Add("b").Text("Results");
                document.Push("ul");

                var actuals = _scripts.GetScripts(queryNames);
                actuals.Each(script => document.Push("li").Text(script.Name));
            }

            document.Pop();

            return document;
        }
Пример #2
0
        public HtmlDocument QueryScripts(ScriptQuery query)
        {
            var queryNames = query.Scripts == null
                                                 ? new string[0]
                                                 : query.Scripts.Split(',').Select(x => x.Trim()).Distinct();



            var document = DiagnosticHtml.BuildDocument(_urls, "Script Graph Query");

            document.Push("div").AddClass("script-query");

            document.Push("form").Attr("action", _urls.UrlFor <ScriptWriter>(x => x.QueryScripts(null)));

            document.Add("b").Text("For requested script names (comma-delimited):  ");
            document.Add(new TextboxTag("Scripts", queryNames.Join(", ")).Id("script-names-text"));
            document.Add("br");
            document.Add("input").Attr("type", "submit").Value("Query");
            document.Pop();



            if (queryNames.Any())
            {
                document.Add("hr");
                document.Add("b").Text("Results");
                document.Push("ul");

                var actuals = _scripts.GetScripts(queryNames);
                actuals.Each(script => document.Push("li").Text(script.Name));
            }

            document.Pop();

            return(document);
        }