Node text for cs/vb constructors

use type name rather than .ctor/,cctor
This commit is contained in:
Ed Harvey
2016-06-08 22:42:38 +10:00
parent 0317bc10f4
commit e2e952a9be
5 changed files with 28 additions and 5 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 315 B

After

Width:  |  Height:  |  Size: 347 B

+9 -1
View File
@@ -585,7 +585,15 @@ namespace ICSharpCode.ILSpy
} else
return property.Name;
}
public override string FormatMethodName(MethodDefinition method)
{
if (method == null)
throw new ArgumentNullException("method");
return (method.IsConstructor) ? method.DeclaringType.Name : method.Name;
}
public override string FormatTypeName(TypeDefinition type)
{
if (type == null)
+8 -1
View File
@@ -138,7 +138,14 @@ namespace ICSharpCode.ILSpy
throw new ArgumentNullException("property");
return property.Name;
}
public virtual string FormatMethodName(MethodDefinition method)
{
if (method == null)
throw new ArgumentNullException("method");
return method.Name;
}
public virtual string FormatTypeName(TypeDefinition type)
{
if (type == null)
+2 -2
View File
@@ -69,7 +69,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
b.Append(") : ");
b.Append(language.TypeToString(method.ReturnType, false, method.MethodReturnType));
b.Append(method.MetadataToken.ToSuffixString());
return HighlightSearchMatch(method.Name, b.ToString());
return HighlightSearchMatch(language.FormatMethodName(method), b.ToString());
}
public override object Icon
@@ -93,7 +93,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
if (method.IsSpecialName &&
(method.Name == ".ctor" || method.Name == ".cctor")) {
return Images.GetIcon(MemberIcon.Constructor, GetOverlayIcon(method.Attributes), false);
return Images.GetIcon(MemberIcon.Constructor, GetOverlayIcon(method.Attributes), method.IsStatic);
}
if (method.HasPInvokeInfo)
+9 -1
View File
@@ -401,7 +401,15 @@ namespace ICSharpCode.ILSpy.VB
Settings = settings
});
}
public override string FormatMethodName(MethodDefinition method)
{
if (method == null)
throw new ArgumentNullException("method");
return (method.IsConstructor) ? method.DeclaringType.Name : method.Name;
}
public override string FormatTypeName(TypeDefinition type)
{
if (type == null)