Example #1
0
 public static string DocUrl(this UrlHelper url, MsDocEntryPoint section, MsDocEntryPointMethod method, object controller)
 {
     var sectionName = section != null ? section.Name : null;
     return method == null ?
                url.DocUrl(sectionName, null, null, null, controller) :
                url.DocUrl(sectionName, method.Category, method.HttpMethod, method.Path, controller);
 }
Example #2
0
 public static object GetRouteValues(MsDocEntryPoint section, MsDocEntryPointMethod method, object controller)
 {
     var sectionName = section != null ? section.Name : null;
     return method == null ?
                GetRouteValues(sectionName, null, null, null, controller) :
                GetRouteValues(sectionName, method.Category, method.HttpMethod, method.Path, controller);
 }
Example #3
0
        public static object GetRouteValues(MsDocEntryPoint section, MsDocEntryPointMethod method, object controller)
        {
            var sectionName = section != null ? section.Name : null;

            return(method == null?
                   GetRouteValues(sectionName, null, null, null, controller) :
                       GetRouteValues(sectionName, method.Category, method.HttpMethod, method.Path, controller));
        }
Example #4
0
        public static string DocUrl(this UrlHelper url, MsDocEntryPoint section, MsDocEntryPointMethod method, object controller)
        {
            var sectionName = section != null ? section.Name : null;

            return(method == null?
                   url.DocUrl(sectionName, null, null, null, controller) :
                       url.DocUrl(sectionName, method.Category, method.HttpMethod, method.Path, controller));
        }
Example #5
0
        public static string GetDocUrl(MsDocEntryPoint section, MsDocEntryPointMethod method, object controller, RequestContext context)
        {
            var sectionName = section != null ? section.Name : null;

            return(method == null?
                   GetDocUrl(sectionName, null, null, null, controller, context) :
                       GetDocUrl(sectionName, method.Category, method.HttpMethod, method.Path, controller, context));
        }
Example #6
0
        public static string GetActionName(MsDocEntryPoint section, MsDocEntryPointMethod method)
        {
            var sectionName = section != null ? section.Name : null;

            return(method == null?
                   GetActionName(sectionName, null, null, null) :
                       GetActionName(sectionName, method.Category, method.HttpMethod, method.Path));
        }
Example #7
0
 public void Add(MsDocEntryPoint section, MsDocEntryPointMethod method)
 {
     if (section != null)
     {
         Add(section.Name, "Docs", "Index", "Documentation", Url.GetRouteValues(section.Name, null, null));
     }
     if (method != null && section != null)
     {
         Add(string.IsNullOrEmpty(method.ShortName) ? (string.IsNullOrEmpty(method.Summary) ? method.FunctionName : method.Summary) : method.ShortName, "Docs", "Index", "Documentation", Url.GetRouteValues(section.Name, method.HttpMethod, method.Path));
     }
 }
 public void Add(MsDocEntryPoint section, MsDocEntryPointMethod method)
 {
     if (section != null)
     {
         Add(section.Name, "Docs", "Index", "Documentation", Url.GetRouteValues(section.Name, null, null));
     }
     if (method != null && section!=null)
     {
         Add(string.IsNullOrEmpty(method.ShortName) ? (string.IsNullOrEmpty(method.Summary) ? method.FunctionName : method.Summary) : method.ShortName, "Docs", "Index", "Documentation", Url.GetRouteValues(section.Name, method.HttpMethod, method.Path));
     }
 }
Example #9
0
        public static MvcHtmlString DocMethodLink(this HtmlHelper helper, MsDocEntryPoint section, MsDocEntryPointMethod method)
        {
            var type = method.HttpMethod;
            var path = method.Path;
            var controller = helper.ViewContext.RequestContext.RouteData.Values["controller"];
            var context = helper.ViewContext.RequestContext;
            
            var spanMethod = new TagBuilder("span");
            spanMethod.AddCssClass("http-" + type.ToLowerInvariant());
            spanMethod.InnerHtml = HttpUtility.HtmlEncode(type);

            var tagBuilder = new TagBuilder("a")
            {
                InnerHtml = spanMethod.ToString(TagRenderMode.Normal) + " " + HttpUtility.HtmlEncode(path)
            };
            tagBuilder.AddCssClass("underline");
            tagBuilder.MergeAttribute("href", Url.GetDocUrl(section, method, controller, context));
            return MvcHtmlString.Create(tagBuilder.ToString(TagRenderMode.Normal));
        }
Example #10
0
 public static MvcHtmlString DocMethodLink(this HtmlHelper helper, MsDocEntryPoint section, MsDocEntryPointMethod method)
 {
     return DocMethodLink(helper, section, method, null);
 }
Example #11
0
 public static MvcHtmlString DocMethodLink(this HtmlHelper helper, MsDocEntryPoint section, MsDocEntryPointMethod method)
 {
     return(DocMethodLink(helper, section, method, null));
 }
Example #12
0
 public static string DocUrl(this UrlHelper url, MsDocEntryPoint section,
                             MsDocEntryPointMethod method)
 {
     return url.DocUrl(section.Name, method.HttpMethod, method.Path);
 }
 public void Add(string text, MsDocEntryPoint section, MsDocEntryPointMethod method, object controller)
 {
     Add(text, Url.GetDocUrl(section, method, controller, _context.ControllerContext.RequestContext));
 }
 public void Add(string text, MsDocEntryPoint section, MsDocEntryPointMethod method, object controller)
 {
     Add(text, Url.GetDocUrl(section, method, controller, _context.ControllerContext.RequestContext));
 }
Example #15
0
 public static string GetRouteName(MsDocEntryPoint section, MsDocEntryPointMethod method)
 {
     var sectionName = section != null ? section.Name : null;
     return method == null ?
                GetRouteName(sectionName, null, null, null) :
                GetRouteName(sectionName, method.Category, method.HttpMethod, method.Path);
 }
Example #16
0
 public static string DocUrl(this UrlHelper url, MsDocEntryPoint section,
                             MsDocEntryPointMethod method)
 {
     return(url.DocUrl(section.Name, method.HttpMethod, method.Path));
 }
 public SectionMethodViewModel(MsDocEntryPoint section, MsDocEntryPointMethod method)
 {
     Section = section;
     Method = method;
 }
Example #18
0
 public MethodViewModel(MsDocEntryPoint section, MsDocEntryPointMethod method)
 {
     Section = section;
     Method  = method;
 }
Example #19
0
 public static MvcHtmlString DocMethodLink(this HtmlHelper helper, MsDocEntryPoint section, MsDocEntryPointMethod method, object htmlAttributes)
 {
     return(DocMethodLink(helper, section.Name, method.HttpMethod, method.Path, htmlAttributes));
 }
Example #20
0
        public static MvcHtmlString DocMethodLink(this HtmlHelper helper, MsDocEntryPoint section, MsDocEntryPointMethod method)
        {
            var type       = method.HttpMethod;
            var path       = method.Path;
            var controller = helper.ViewContext.RequestContext.RouteData.Values["controller"];
            var context    = helper.ViewContext.RequestContext;

            var spanMethod = new TagBuilder("span");

            spanMethod.AddCssClass("http-" + type.ToLowerInvariant());
            spanMethod.InnerHtml = HttpUtility.HtmlEncode(type);

            var tagBuilder = new TagBuilder("a")
            {
                InnerHtml = spanMethod.ToString(TagRenderMode.Normal) + " " + HttpUtility.HtmlEncode(path)
            };

            tagBuilder.AddCssClass("underline");
            tagBuilder.MergeAttribute("href", Url.GetDocUrl(section, method, controller, context));
            return(MvcHtmlString.Create(tagBuilder.ToString(TagRenderMode.Normal)));
        }
Example #21
0
 public static MvcHtmlString DocMethodLink(this HtmlHelper helper, MsDocEntryPoint section, MsDocEntryPointMethod method, object htmlAttributes)
 {
     return DocMethodLink(helper, section.Name, method.HttpMethod, method.Path, htmlAttributes);
 }
Example #22
0
 public static string GetDocUrl(MsDocEntryPoint section, MsDocEntryPointMethod method, object controller, RequestContext context)
 {
     var sectionName = section != null ? section.Name : null;
     return method == null ?
                GetDocUrl(sectionName, null, null, null, controller, context) :
                GetDocUrl(sectionName, method.Category, method.HttpMethod, method.Path, controller, context);
 }