Browse Source

Fixed naming variables after the property they get their initial value from.

pull/100/head
Daniel Grunwald 15 years ago
parent
commit
5e2641732a
  1. 6
      ICSharpCode.Decompiler/Ast/NameVariables.cs

6
ICSharpCode.Decompiler/Ast/NameVariables.cs

@ -159,6 +159,8 @@ namespace ICSharpCode.Decompiler.Ast @@ -159,6 +159,8 @@ namespace ICSharpCode.Decompiler.Ast
return CleanUpVariableName(((FieldReference)expr.Operand).Name);
case ILCode.Call:
case ILCode.Callvirt:
case ILCode.CallGetter:
case ILCode.CallvirtGetter:
MethodReference mr = (MethodReference)expr.Operand;
if (mr.Name.StartsWith("get_", StringComparison.OrdinalIgnoreCase) && mr.Parameters.Count == 0) {
// use name from properties, but not from indexers
@ -184,6 +186,10 @@ namespace ICSharpCode.Decompiler.Ast @@ -184,6 +186,10 @@ namespace ICSharpCode.Decompiler.Ast
case ILCode.Call:
case ILCode.Callvirt:
case ILCode.Newobj:
case ILCode.CallGetter:
case ILCode.CallvirtGetter:
case ILCode.CallSetter:
case ILCode.CallvirtSetter:
MethodReference methodRef = (MethodReference)parent.Operand;
if (methodRef.Parameters.Count == 1 && i == parent.Arguments.Count - 1) {
// argument might be value of a setter

Loading…
Cancel
Save