mirror of
https://github.com/icsharpcode/ILSpy.git
synced 2026-10-12 02:15:58 +00:00
Node text for cs/vb constructors
use type name rather than .ctor/,cctor
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 315 B After Width: | Height: | Size: 347 B |
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user