Exemple #1
0
        private static Content BuildPrettyName(MethodInfo method)
        {
            var c = new Content();

            c.AddPlainText(method.Name);

            if (method.IsGenericMethod)
            {
                c.AddPlainText("<" + string.Join(", ", method.GetGenericArguments().Select(o => o.Name)) + ">");
            }

            c.AddPlainText("(");

            var args = method.GetParameters();

            for (int i = 0; i < args.Length; i++)
            {
                args[i].ParameterType.GenerateNameContent(c, true);
                c.AddPlainText(" " + args[i].Name + (i < args.Length - 1 ? ", " : null));
            }

            c.AddPlainText(")");

            return(c);
        }