Browse Source

Improved ToString() for methods.

newNRvisualizers
Daniel Grunwald 14 years ago
parent
commit
58d7ac0ee6
  1. 25
      ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultResolvedMethod.cs
  2. 3
      ICSharpCode.NRefactory/TypeSystem/Implementation/SpecializedMethod.cs

25
ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultResolvedMethod.cs

@ -19,6 +19,8 @@ @@ -19,6 +19,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ICSharpCode.NRefactory.Semantics;
namespace ICSharpCode.NRefactory.TypeSystem.Implementation
@ -217,6 +219,29 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -217,6 +219,29 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
}
}
public override string ToString()
{
StringBuilder b = new StringBuilder("[");
b.Append(this.EntityType);
b.Append(' ');
b.Append(this.DeclaringType.ReflectionName);
b.Append('.');
b.Append(this.Name);
if (this.TypeParameters.Count > 0) {
b.Append("``");
b.Append(this.TypeParameters.Count);
}
b.Append('(');
for (int i = 0; i < this.Parameters.Count; i++) {
if (i > 0) b.Append(", ");
b.Append(this.Parameters[i].ToString());
}
b.Append("):");
b.Append(this.ReturnType.ReflectionName);
b.Append(']');
return b.ToString();
}
/// <summary>
/// Gets a dummy constructor for the specified compilation.
/// </summary>

3
ICSharpCode.NRefactory/TypeSystem/Implementation/SpecializedMethod.cs

@ -195,6 +195,9 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -195,6 +195,9 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
b.Append(this.TypeArguments[i].ReflectionName);
}
b.Append(']');
} else if (this.TypeParameters.Count > 0) {
b.Append("``");
b.Append(this.TypeParameters.Count);
}
b.Append('(');
for (int i = 0; i < this.Parameters.Count; i++) {

Loading…
Cancel
Save