Permalink
Browse files

Using the property names from metadata rather then deriving from acce…

…ssor methods.
  • Loading branch information...
1 parent 27de13f commit 9b7031194579169e8978d7e70b1e5fb4f3ce5b5e @dsrbecky dsrbecky committed Oct 25, 2010
@@ -10,6 +10,7 @@ public class DebuggerException: System.Exception
{
public DebuggerException() {}
public DebuggerException(string message): base(message) {}
+ public DebuggerException(string message, params object[] args): base(string.Format(message, args)) {}
public DebuggerException(string message, System.Exception inner): base(message, inner) {}
}
@@ -12,14 +12,16 @@ namespace Debugger.MetaData
public class DebugPropertyInfo : System.Reflection.PropertyInfo, IDebugMemberInfo, IOverloadable
{
DebugType declaringType;
+ string name;
MethodInfo getMethod;
MethodInfo setMethod;
- internal DebugPropertyInfo(DebugType declaringType, MethodInfo getMethod, MethodInfo setMethod)
+ internal DebugPropertyInfo(DebugType declaringType, string name, MethodInfo getMethod, MethodInfo setMethod)
{
if (getMethod == null && setMethod == null) throw new ArgumentNullException("Both getter and setter can not be null.");
this.declaringType = declaringType;
+ this.name = name;
this.getMethod = getMethod;
this.setMethod = setMethod;
}
@@ -56,9 +58,7 @@ internal DebugPropertyInfo(DebugType declaringType, MethodInfo getMethod, Method
/// <inheritdoc/>
public override string Name {
- get {
- return (getMethod ?? setMethod).Name.Remove(0,4);
- }
+ get { return name; }
}
/// <summary> Name including the declaring type, return type and parameters </summary>
@@ -1299,6 +1299,7 @@ void LoadMembers()
foreach(PropertyProps prop in module.MetaData.EnumPropertyProps((uint)this.MetadataToken)) {
DebugPropertyInfo propInfo = new DebugPropertyInfo(
this,
+ prop.Name,
prop.GetterMethod != 0x06000000 ? GetMethod(prop.GetterMethod) : null,
prop.SetterMethod != 0x06000000 ? GetMethod(prop.SetterMethod) : null
);

0 comments on commit 9b70311

Please sign in to comment.