private static string Show(this ParameterDefinition p, FormatDetail detail)
        {
            var sb = new StringBuilder();

            sb.Append(p.IsIn && p.IsOut ? "ref " : p.IsIn ? "in " : p.IsOut ? "out " : "");
            sb.Append(Show(p.ParameterType, detail));
            sb.Append(' ');
            sb.Append(p.Name);
            if (p.IsOptional)
            {
                sb.Append(" = ");
                sb.Append(p.Constant ?? "null"); // TODO: I suspect `Constant` is not the right way to do this.
            }
            return(sb.ToString());
        }
        public static string Show(this TypeReference type, FormatDetail detail)
        {
            if (type.FullName == "System.Void")
            {
                return("void");
            }
            var prefix = type.DeclaringType != null
                ? Show(type.DeclaringType, detail) + "."
                : detail == FormatDetail.Full ? type.Namespace + "." : "";

            switch (type)
            {
            case GenericInstanceType generic:
                return($"{prefix}{type.Name.Split('`')[0]}{generic.GenericArguments.ShowGenArgs(detail)}");

            default:
                return($"{prefix}{type.Name}");
            }
        }
 public static string Show(this PropertyDefinition property, FormatDetail detail) =>
 $"{property.PropertyType.Show(detail)} {property.Name}{property.Parameters.Show('[', ']', false, detail)} " +
 $"{{ {(property.GetMethod != null ? "get; " : "")}{(property.SetMethod != null ? "set; " : "")}}}";
 public static string Show(this MethodDefinition method, FormatDetail detail) =>
 $"{method.ReturnType.Show(detail)} {method.Name}{method.GenericParameters.Show(detail)}{method.Parameters.Show('(', ')', true, detail)}";
 private static string Show(this IList <ParameterDefinition> ps, char open, char close, bool openCloseIfEmpty, FormatDetail detail) =>
 ps.Any() ? $"{open}{string.Join(", ", ps.Select(p => p.Show(detail)))}{close}" : openCloseIfEmpty ? $"{open}{close}" : "";
 private static string ShowGenArgs(this IList <TypeReference> types, FormatDetail detail) =>
 types.Any() ? $"<{string.Join(", ", types.Select(type => type.Show(detail)))}>" : "";
 private static string Show(this IList <GenericParameter> ps, FormatDetail detail) =>
 ps.Any() ? $"<{string.Join(", ", ps.Select(p => p.Show(detail)))}>" : "";