Don't add prop/event 'other' methods to props/events list
This commit is contained in:
parent
8d5dae6dcf
commit
1e22947f6a
|
@ -703,9 +703,9 @@ namespace de4dot.renamer {
|
||||||
foreach (var scope in allScopes) {
|
foreach (var scope in allScopes) {
|
||||||
if (scope.hasNonRenamableMethod())
|
if (scope.hasNonRenamableMethod())
|
||||||
continue;
|
continue;
|
||||||
else if (scope.hasPropertyMethod() && getPropertyMethodType(scope.Methods[0]) != PropertyMethodType.Other)
|
else if (scope.hasGetterOrSetterPropertyMethod() && getPropertyMethodType(scope.Methods[0]) != PropertyMethodType.Other)
|
||||||
propMethods.add(scope);
|
propMethods.add(scope);
|
||||||
else if (scope.hasEventMethod())
|
else if (scope.hasAddRemoveOrRaiseEventMethod())
|
||||||
eventMethods.add(scope);
|
eventMethods.add(scope);
|
||||||
else if (scope.hasInterfaceMethod())
|
else if (scope.hasInterfaceMethod())
|
||||||
ifaceMethods.add(scope);
|
ifaceMethods.add(scope);
|
||||||
|
|
|
@ -58,21 +58,24 @@ namespace de4dot.renamer.asmmodules {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool hasPropertyMethod() {
|
public bool hasGetterOrSetterPropertyMethod() {
|
||||||
foreach (var method in methods) {
|
foreach (var method in methods) {
|
||||||
if (method.Property != null)
|
if (method.Property == null)
|
||||||
|
continue;
|
||||||
|
var prop = method.Property;
|
||||||
|
if (method == prop.GetMethod || method == prop.SetMethod)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool hasEventMethod() {
|
public bool hasAddRemoveOrRaiseEventMethod() {
|
||||||
foreach (var method in methods) {
|
foreach (var method in methods) {
|
||||||
if (method.Event != null) {
|
if (method.Event == null)
|
||||||
var evt = method.Event;
|
continue;
|
||||||
if (method == evt.AddMethod || method == evt.RemoveMethod || method == evt.RaiseMethod)
|
var evt = method.Event;
|
||||||
return true;
|
if (method == evt.AddMethod || method == evt.RemoveMethod || method == evt.RaiseMethod)
|
||||||
}
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user