Browse Source

Remove isIndexer parameter from PropertyToString, always use IProperty.IsIndexer

pull/1030/head
Siegfried Pammer 7 years ago
parent
commit
482d6dec93
  1. 4
      ILSpy/Languages/CSharpLanguage.cs
  2. 2
      ILSpy/Languages/Language.cs
  3. 2
      ILSpy/SearchStrategies.cs

4
ILSpy/Languages/CSharpLanguage.cs

@ -440,12 +440,12 @@ namespace ICSharpCode.ILSpy
return TypeToStringInternal(field.DeclaringTypeDefinition, includeNamespace) + "." + simple; return TypeToStringInternal(field.DeclaringTypeDefinition, includeNamespace) + "." + simple;
} }
public override string PropertyToString(IProperty property, bool includeTypeName, bool includeNamespace, bool? isIndexer = null) public override string PropertyToString(IProperty property, bool includeTypeName, bool includeNamespace)
{ {
if (property == null) if (property == null)
throw new ArgumentNullException(nameof(property)); throw new ArgumentNullException(nameof(property));
var buffer = new System.Text.StringBuilder(); var buffer = new System.Text.StringBuilder();
if (isIndexer.Value) { if (property.IsIndexer) {
if (property.IsExplicitInterfaceImplementation) { if (property.IsExplicitInterfaceImplementation) {
string name = property.Name; string name = property.Name;
int index = name.LastIndexOf('.'); int index = name.LastIndexOf('.');

2
ILSpy/Languages/Language.cs

@ -180,7 +180,7 @@ namespace ICSharpCode.ILSpy
return GetDisplayName(field, includeTypeName, includeNamespace) + " : " + TypeToString(field.ReturnType, includeNamespace); return GetDisplayName(field, includeTypeName, includeNamespace) + " : " + TypeToString(field.ReturnType, includeNamespace);
} }
public virtual string PropertyToString(IProperty property, bool includeTypeName, bool includeNamespace, bool? isIndexer = null) public virtual string PropertyToString(IProperty property, bool includeTypeName, bool includeNamespace)
{ {
if (property == null) if (property == null)
throw new ArgumentNullException(nameof(property)); throw new ArgumentNullException(nameof(property));

2
ILSpy/SearchStrategies.cs

@ -167,7 +167,7 @@ namespace ICSharpCode.ILSpy
case IField f: case IField f:
return language.FieldToString(f, fullName, fullName); return language.FieldToString(f, fullName, fullName);
case IProperty p: case IProperty p:
return language.PropertyToString(p, fullName, fullName, p.IsIndexer); return language.PropertyToString(p, fullName, fullName);
case IMethod m: case IMethod m:
return language.MethodToString(m, fullName, fullName); return language.MethodToString(m, fullName, fullName);
case IEvent e: case IEvent e:

Loading…
Cancel
Save