Remove useless method and only rename if not renamed
This commit is contained in:
parent
1f7f9958ab
commit
66b3061444
|
@ -286,8 +286,15 @@ namespace de4dot.code.renamer {
|
||||||
void prepareRenameMethodArgs(MethodDef methodDef) {
|
void prepareRenameMethodArgs(MethodDef methodDef) {
|
||||||
if (methodDef.ParamDefs.Count > 0) {
|
if (methodDef.ParamDefs.Count > 0) {
|
||||||
if (isEventHandler(methodDef)) {
|
if (isEventHandler(methodDef)) {
|
||||||
param(methodDef.ParamDefs[0]).newName = "sender";
|
ParamInfo info;
|
||||||
param(methodDef.ParamDefs[1]).newName = "e";
|
|
||||||
|
info = param(methodDef.ParamDefs[0]);
|
||||||
|
if (!info.gotNewName())
|
||||||
|
info.newName = "sender";
|
||||||
|
|
||||||
|
info = param(methodDef.ParamDefs[1]);
|
||||||
|
if (!info.gotNewName())
|
||||||
|
info.newName = "e";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var newVariableNameState = variableNameState.clone();
|
var newVariableNameState = variableNameState.clone();
|
||||||
|
@ -793,12 +800,6 @@ namespace de4dot.code.renamer {
|
||||||
return type.FullName.EndsWith("EventHandler", StringComparison.Ordinal);
|
return type.FullName.EndsWith("EventHandler", StringComparison.Ordinal);
|
||||||
}
|
}
|
||||||
|
|
||||||
static MethodReference getOverrideMethod(MethodDefinition meth) {
|
|
||||||
if (meth == null || !meth.HasOverrides)
|
|
||||||
return null;
|
|
||||||
return meth.Overrides[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
string findWindowsFormsClassName(TypeDef type) {
|
string findWindowsFormsClassName(TypeDef type) {
|
||||||
foreach (var methodDef in type.AllMethods) {
|
foreach (var methodDef in type.AllMethods) {
|
||||||
if (methodDef.MethodDefinition.Body == null)
|
if (methodDef.MethodDefinition.Body == null)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user