예제 #1
0
        public ActionResult Index(string section, string type, string url)
        {
            if (string.IsNullOrEmpty(section))
            {
                //Render all
                return(View("Toc", Documentation.GetAll()));
            }
            var docsSection = Documentation.GetDocs(section);

            if (docsSection == null)
            {
                return(View("SectionNotFound"));
            }
            _breadCrumbsBuilder.Add(docsSection);
            if (!string.IsNullOrEmpty(type) && !string.IsNullOrEmpty(url))
            {
                //Lookup method
                var function = docsSection.Methods.Where(x => x.Path.Equals(url, StringComparison.OrdinalIgnoreCase) && x.HttpMethod.Equals(type, StringComparison.OrdinalIgnoreCase)).SingleOrDefault();
                if (function != null)
                {
                    _breadCrumbsBuilder.Add(docsSection, function);
                    return(View("Function", new SectionMethodViewModel(docsSection, function)));
                }
                return(View("FunctionNotFound"));
            }
            return(View("Section", docsSection));
        }
예제 #2
0
 public ActionResult Toc(string type)
 {
     if (string.Equals("top", type))
     {
         return(PartialView("TopTocControl", Documentation.GetAll()));
     }
     return(PartialView("TocContorl", Documentation.GetAll()));
 }
예제 #3
0
 public ActionResult Navigation()
 {
     return(View(Documentation.GetAll()));
 }