public static string FormatMethodName(MetadataReader metadataReader, TypeDefinitionHandle enclosingTypeHandle, MethodHandle methodHandle) { MethodNameFormatter formatter = new MethodNameFormatter(metadataReader, SigTypeContext.FromMethod(metadataReader, enclosingTypeHandle, methodHandle)); Method method = metadataReader.GetMethod(methodHandle); MethodSignature methodSignature = metadataReader.GetMethodSignature(method.Signature); formatter.EmitTypeName(enclosingTypeHandle, namespaceQualified: true); formatter._outputBuilder.Append('.'); formatter.EmitString(method.Name); bool first = true; foreach (GenericParameterHandle handle in method.GenericParameters) { if (first) { first = false; formatter._outputBuilder.Append('['); } else { formatter._outputBuilder.Append(", "); } formatter.EmitTypeName(handle, namespaceQualified: false); } if (!first) { formatter._outputBuilder.Append(']'); } formatter.EmitMethodParameters(methodSignature); return(formatter._outputBuilder.ToString()); }
public static string FormatMethodName(MetadataReader metadataReader, Handle methodHandle) { MethodNameFormatter formatter = new MethodNameFormatter(metadataReader, SigTypeContext.FromMethod(metadataReader, methodHandle)); formatter.EmitMethodName(methodHandle); return(formatter._outputBuilder.ToString()); }