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) {
|
||||
if (scope.hasNonRenamableMethod())
|
||||
continue;
|
||||
else if (scope.hasPropertyMethod() && getPropertyMethodType(scope.Methods[0]) != PropertyMethodType.Other)
|
||||
else if (scope.hasGetterOrSetterPropertyMethod() && getPropertyMethodType(scope.Methods[0]) != PropertyMethodType.Other)
|
||||
propMethods.add(scope);
|
||||
else if (scope.hasEventMethod())
|
||||
else if (scope.hasAddRemoveOrRaiseEventMethod())
|
||||
eventMethods.add(scope);
|
||||
else if (scope.hasInterfaceMethod())
|
||||
ifaceMethods.add(scope);
|
||||
|
|
|
@ -58,22 +58,25 @@ namespace de4dot.renamer.asmmodules {
|
|||
return false;
|
||||
}
|
||||
|
||||
public bool hasPropertyMethod() {
|
||||
public bool hasGetterOrSetterPropertyMethod() {
|
||||
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 false;
|
||||
}
|
||||
|
||||
public bool hasEventMethod() {
|
||||
public bool hasAddRemoveOrRaiseEventMethod() {
|
||||
foreach (var method in methods) {
|
||||
if (method.Event != null) {
|
||||
if (method.Event == null)
|
||||
continue;
|
||||
var evt = method.Event;
|
||||
if (method == evt.AddMethod || method == evt.RemoveMethod || method == evt.RaiseMethod)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user