Ejemplo n.º 1
0
        //
        // GET: /Docs/
        public ActionResult Method(string className, string methodName, Frameworks framework = Frameworks.NotSet, int o = 0)
        {
            Models.Class @class;

            var formattedMethodName = methodName.Replace('(', '<').Replace(')', '>');

            var method = _repo.GetMethod(className, formattedMethodName, framework, out @class, o);
            if (method == null) return HttpNotFound();

            this.SetMetaDescription("The syntax and description of the {0}.{1} method.", @class.Name, formattedMethodName);
            this.AddMetaKeywords("Method", @class.Name, method.Name);

            var viewModel = new Method()
            {
                Namespace = @class.Namespace,
                Class = @class.Name,
                Name = method.Name,
                Arguments = method.Arguments,
                IsStatic = method.IsStatic,
                IsExtensionMethod = method.IsExtensionMethod,
                ReturnType = method.ReturnType,
                Remarks = method.Remarks,
                Description = method.Description,
                Examples = method.Examples,
                ReturnDescription = method.ReturnDescription,
                Frameworks = method.Frameworks,
                HasParamsArgument = method.HasParamsArgument
            };

            return View(viewModel);
        }
Ejemplo n.º 2
0
        //
        // GET: /Docs/
        public ActionResult Method(string className, string methodName, Frameworks framework = Frameworks.NotSet, int o = 0)
        {
            Models.Class @class;

            var formattedMethodName = methodName.Replace('(', '<').Replace(')', '>');

            var method = _repo.GetMethod(className, formattedMethodName, framework, out @class, o);

            if (method == null)
            {
                return(HttpNotFound());
            }

            this.SetMetaDescription("The syntax and description of the {0}.{1} method.", @class.Name, formattedMethodName);
            this.AddMetaKeywords("Method", @class.Name, method.Name);

            var viewModel = new Method()
            {
                Namespace         = @class.Namespace,
                Class             = @class.Name,
                Name              = method.Name,
                Arguments         = method.Arguments,
                IsStatic          = method.IsStatic,
                IsExtensionMethod = method.IsExtensionMethod,
                ReturnType        = method.ReturnType,
                Remarks           = method.Remarks,
                Description       = method.Description,
                Examples          = method.Examples,
                ReturnDescription = method.ReturnDescription,
                Frameworks        = method.Frameworks,
                HasParamsArgument = method.HasParamsArgument
            };

            return(View(viewModel));
        }