Exemplo n.º 1
0
        private void ServeIndex(HttpProcessor p, string url)
        {
            List <SearchResult> results = new List <SearchResult>();

            string[] index = SearchHelpers.SearchIndex;

            foreach (string each in index)
            {
                string contents = SearchHelpers.GetResourceContents(each);

                Dictionary <string, string> meta = SearchHelpers.GetPageAttributes(contents, out contents);
                SearchResult result = new SearchResult(each, meta[SearchHelpers.TitleAttribute]);
                results.Add(result);
            }

            HtmlGenerator html = new HtmlGenerator(results, "");

            p.WriteSuccessHeaders(200, "text/html", html.HTML);
        }