Use hasReturnValue() method
This commit is contained in:
parent
3cde99b2e7
commit
38fb775a7e
|
@ -453,7 +453,7 @@ namespace de4dot.code.renamer {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var newPropertyName = overridePrefix + propDef.PropertyDefinition.Name;
|
var newPropertyName = overridePrefix + propDef.PropertyDefinition.Name;
|
||||||
if (methodDef.MethodDefinition.MethodReturnType.ReturnType.FullName == "System.Void")
|
if (!DotNetUtils.hasReturnValue(methodDef.MethodDefinition))
|
||||||
createPropertySetter(newPropertyName, methodDef);
|
createPropertySetter(newPropertyName, methodDef);
|
||||||
else
|
else
|
||||||
createPropertyGetter(newPropertyName, methodDef);
|
createPropertyGetter(newPropertyName, methodDef);
|
||||||
|
@ -755,7 +755,7 @@ namespace de4dot.code.renamer {
|
||||||
}
|
}
|
||||||
|
|
||||||
TypeReference getEventType(MethodReference method) {
|
TypeReference getEventType(MethodReference method) {
|
||||||
if (method.MethodReturnType.ReturnType.FullName != "System.Void")
|
if (DotNetUtils.hasReturnValue(method))
|
||||||
return null;
|
return null;
|
||||||
if (method.Parameters.Count != 1)
|
if (method.Parameters.Count != 1)
|
||||||
return null;
|
return null;
|
||||||
|
@ -1281,7 +1281,7 @@ namespace de4dot.code.renamer {
|
||||||
}
|
}
|
||||||
|
|
||||||
static PropertyMethodType getPropertyMethodType(MethodDef method) {
|
static PropertyMethodType getPropertyMethodType(MethodDef method) {
|
||||||
if (method.MethodDefinition.MethodReturnType.ReturnType.FullName != "System.Void")
|
if (DotNetUtils.hasReturnValue(method.MethodDefinition))
|
||||||
return PropertyMethodType.Getter;
|
return PropertyMethodType.Getter;
|
||||||
if (method.ParamDefs.Count > 0)
|
if (method.ParamDefs.Count > 0)
|
||||||
return PropertyMethodType.Setter;
|
return PropertyMethodType.Setter;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user