Browse Source

Node text for cs/vb constructors

use type name rather than .ctor/,cctor
pull/724/head
Ed Harvey 9 years ago
parent
commit
e2e952a9be
  1. BIN
      ILSpy/Images/OverlayStatic.png
  2. 8
      ILSpy/Languages/CSharpLanguage.cs
  3. 7
      ILSpy/Languages/Language.cs
  4. 4
      ILSpy/TreeNodes/MethodTreeNode.cs
  5. 8
      ILSpy/VB/VBLanguage.cs

BIN
ILSpy/Images/OverlayStatic.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 315 B

After

Width:  |  Height:  |  Size: 347 B

8
ILSpy/Languages/CSharpLanguage.cs

@ -586,6 +586,14 @@ namespace ICSharpCode.ILSpy @@ -586,6 +586,14 @@ namespace ICSharpCode.ILSpy
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)

7
ILSpy/Languages/Language.cs

@ -139,6 +139,13 @@ namespace ICSharpCode.ILSpy @@ -139,6 +139,13 @@ namespace ICSharpCode.ILSpy
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)

4
ILSpy/TreeNodes/MethodTreeNode.cs

@ -69,7 +69,7 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -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 @@ -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)

8
ILSpy/VB/VBLanguage.cs

@ -402,6 +402,14 @@ namespace ICSharpCode.ILSpy.VB @@ -402,6 +402,14 @@ namespace ICSharpCode.ILSpy.VB
});
}
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)

Loading…
Cancel
Save