Changeset 86 for binary-improvements/NamePatcher
- Timestamp:
- Jul 19, 2014, 1:17:49 PM (11 years ago)
- Location:
- binary-improvements/NamePatcher
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/NamePatcher/NamePatcher.cs
r84 r86 86 86 foreach (FieldDefinition fd in mainModule.GetType ("ConnectionManager").Fields) { 87 87 TypeReference fdType = fd.FieldType; 88 if (fdType.FullName.Equals ("GameManager")) { 89 Console.WriteLine ("Renaming and making public ConnectionManager field -> gameManager"); 90 fd.Attributes = fd.Attributes & (~Mono.Cecil.FieldAttributes.Private) | Mono.Cecil.FieldAttributes.Public; 91 NameNormalizer.setName (fd, "gameManager"); 92 } 88 93 if (fdType.FullName.Contains ("Dictionary") && fdType.FullName.Contains ("ClientInfo")) { 89 94 Console.WriteLine ("Renaming and making public ConnectionManager field -> connectedClients"); … … 143 148 if (consoleCommandTypeName.Length > 0) { 144 149 foreach (MethodDefinition md in typeConsole.Methods) { 145 if (md.Parameters.Count == 1 && md.Parameters [0].ParameterType.Name.Equals (consoleCommandTypeName)) { 146 Console.WriteLine ("Renaming console method -> AddCommand"); 147 NameNormalizer.setName (md, "AddCommand"); 150 if (!md.IsConstructor) { 151 if (md.Parameters.Count == 1 && md.Parameters [0].ParameterType.Name.Equals (consoleCommandTypeName)) { 152 Console.WriteLine ("Renaming console method -> AddCommand"); 153 NameNormalizer.setName (md, "AddCommand"); 154 } 155 if (md.Parameters.Count == 1 && md.Parameters [0].ParameterType.FullName.Equals ("System.String") && md.ReturnType.FullName.Equals (consoleCommandTypeName)) { 156 Console.WriteLine ("Renaming console method -> getCommand"); 157 NameNormalizer.setName (md, "getCommand"); 158 } 148 159 } 149 160 } -
binary-improvements/NamePatcher/NamePatcher.userprefs
r84 r86 3 3 <MonoDevelop.Ide.Workbench ActiveDocument="NamePatcher.cs"> 4 4 <Files> 5 <File FileName="NamePatcher.cs" Line=" 109" Column="57" />5 <File FileName="NamePatcher.cs" Line="98" Column="5" /> 6 6 <File FileName="NameNormalizer.cs" Line="188" Column="1" /> 7 7 </Files>
Note:
See TracChangeset
for help on using the changeset viewer.