Rename method to getValues()

This commit is contained in:
de4dot 2012-01-01 12:09:16 +01:00
parent 970ef14266
commit ac30b8c213
4 changed files with 35 additions and 35 deletions

View File

@ -58,7 +58,7 @@ namespace de4dot.blocks {
return tokenToKey.Values;
}
public IEnumerable<TValue> getAll() {
public IEnumerable<TValue> getValues() {
return tokenToValue.Values;
}
@ -138,7 +138,7 @@ namespace de4dot.blocks {
return tokenToKey.Values;
}
public IEnumerable<TValue> getAll() {
public IEnumerable<TValue> getValues() {
return tokenToValue.Values;
}
@ -228,7 +228,7 @@ namespace de4dot.blocks {
return tokenToKey.Values;
}
public IEnumerable<TValue> getAll() {
public IEnumerable<TValue> getValues() {
return tokenToValue.Values;
}
@ -317,7 +317,7 @@ namespace de4dot.blocks {
return tokenToKey.Values;
}
public IEnumerable<TValue> getAll() {
public IEnumerable<TValue> getValues() {
return tokenToValue.Values;
}
@ -386,7 +386,7 @@ namespace de4dot.blocks {
return tokenToKey.Values;
}
public IEnumerable<TValue> getAll() {
public IEnumerable<TValue> getValues() {
return tokenToValue.Values;
}

View File

@ -70,7 +70,7 @@ namespace de4dot.code.renamer.asmmodules {
}
public IEnumerable<TypeDef> getAllTypes() {
return types.getAll();
return types.getValues();
}
public IEnumerable<MethodDefinition> getAllMethods() {
@ -131,7 +131,7 @@ namespace de4dot.code.renamer.asmmodules {
public void onTypesRenamed() {
var newTypes = new TypeDefDict();
foreach (var typeDef in types.getAll()) {
foreach (var typeDef in types.getValues()) {
typeDef.onTypesRenamed();
newTypes.add(typeDef);
}

View File

@ -24,7 +24,7 @@ using de4dot.blocks;
namespace de4dot.code.renamer.asmmodules {
interface RefDict<TRef, TMRef> where TRef : Ref where TMRef : MemberReference {
int Count { get; }
IEnumerable<TRef> getAll();
IEnumerable<TRef> getValues();
IEnumerable<TRef> getSorted();
TRef find(TMRef tmref);
TRef findAny(TMRef tmref);
@ -39,12 +39,12 @@ namespace de4dot.code.renamer.asmmodules {
get { return typeToDef.Count; }
}
public IEnumerable<TypeDef> getAll() {
return typeToDef.getAll();
public IEnumerable<TypeDef> getValues() {
return typeToDef.getValues();
}
public IEnumerable<TypeDef> getSorted() {
var list = new List<TypeDef>(getAll());
var list = new List<TypeDef>(getValues());
list.Sort((a, b) => Utils.compareInt32(a.Index, b.Index));
return list;
}
@ -73,12 +73,12 @@ namespace de4dot.code.renamer.asmmodules {
get { return fieldToDef.Count; }
}
public IEnumerable<FieldDef> getAll() {
return fieldToDef.getAll();
public IEnumerable<FieldDef> getValues() {
return fieldToDef.getValues();
}
public IEnumerable<FieldDef> getSorted() {
var list = new List<FieldDef>(getAll());
var list = new List<FieldDef>(getValues());
list.Sort((a, b) => Utils.compareInt32(a.Index, b.Index));
return list;
}
@ -107,12 +107,12 @@ namespace de4dot.code.renamer.asmmodules {
get { return methodToDef.Count; }
}
public IEnumerable<MethodDef> getAll() {
return methodToDef.getAll();
public IEnumerable<MethodDef> getValues() {
return methodToDef.getValues();
}
public IEnumerable<MethodDef> getSorted() {
var list = new List<MethodDef>(getAll());
var list = new List<MethodDef>(getValues());
list.Sort((a, b) => Utils.compareInt32(a.Index, b.Index));
return list;
}
@ -141,12 +141,12 @@ namespace de4dot.code.renamer.asmmodules {
get { return propToDef.Count; }
}
public IEnumerable<PropertyDef> getAll() {
return propToDef.getAll();
public IEnumerable<PropertyDef> getValues() {
return propToDef.getValues();
}
public IEnumerable<PropertyDef> getSorted() {
var list = new List<PropertyDef>(getAll());
var list = new List<PropertyDef>(getValues());
list.Sort((a, b) => Utils.compareInt32(a.Index, b.Index));
return list;
}
@ -175,12 +175,12 @@ namespace de4dot.code.renamer.asmmodules {
get { return eventToDef.Count; }
}
public IEnumerable<EventDef> getAll() {
return eventToDef.getAll();
public IEnumerable<EventDef> getValues() {
return eventToDef.getValues();
}
public IEnumerable<EventDef> getSorted() {
var list = new List<EventDef>(getAll());
var list = new List<EventDef>(getValues());
list.Sort((a, b) => Utils.compareInt32(a.Index, b.Index));
return list;
}

View File

@ -246,19 +246,19 @@ namespace de4dot.code.renamer.asmmodules {
}
public IEnumerable<EventDef> AllEvents {
get { return events.getAll(); }
get { return events.getValues(); }
}
public IEnumerable<FieldDef> AllFields {
get { return fields.getAll(); }
get { return fields.getValues(); }
}
public IEnumerable<MethodDef> AllMethods {
get { return methods.getAll(); }
get { return methods.getValues(); }
}
public IEnumerable<PropertyDef> AllProperties {
get { return properties.getAll(); }
get { return properties.getValues(); }
}
public IEnumerable<EventDef> AllEventsSorted {
@ -379,7 +379,7 @@ namespace de4dot.code.renamer.asmmodules {
for (int i = 0; i < type.Properties.Count; i++)
add(new PropertyDef(type.Properties[i], this, i));
foreach (var propDef in properties.getAll()) {
foreach (var propDef in properties.getValues()) {
foreach (var method in propDef.methodDefinitions()) {
var methodDef = find(method);
if (methodDef == null)
@ -392,7 +392,7 @@ namespace de4dot.code.renamer.asmmodules {
}
}
foreach (var eventDef in events.getAll()) {
foreach (var eventDef in events.getValues()) {
foreach (var method in eventDef.methodDefinitions()) {
var methodDef = find(method);
if (methodDef == null)
@ -448,7 +448,7 @@ namespace de4dot.code.renamer.asmmodules {
if (baseType != null)
baseType.typeDef.initializeVirtualMembers(scopes, resolver);
foreach (var methodDef in methods.getAll()) {
foreach (var methodDef in methods.getValues()) {
if (methodDef.isVirtual())
scopes.add(methodDef);
}
@ -507,7 +507,7 @@ namespace de4dot.code.renamer.asmmodules {
//--- methods to implement the corresponding interface method.
if (interfaces.Count > 0) {
methodsDict.Clear();
foreach (var method in methods.getAll()) {
foreach (var method in methods.getValues()) {
if (!method.isPublic() || !method.isVirtual() || !method.isNewSlot())
continue;
methodsDict[new MethodReferenceKey(method.MethodDefinition)] = method;
@ -572,14 +572,14 @@ namespace de4dot.code.renamer.asmmodules {
var ifaceMethodsDict = new Dictionary<MethodReferenceAndDeclaringTypeKey, MethodDef>();
foreach (var ifaceInfo in allImplementedInterfaces.Keys) {
var git = ifaceInfo.typeReference as GenericInstanceType;
foreach (var ifaceMethod in ifaceInfo.typeDef.methods.getAll()) {
foreach (var ifaceMethod in ifaceInfo.typeDef.methods.getValues()) {
MethodReference ifaceMethodReference = ifaceMethod.MethodDefinition;
if (git != null)
ifaceMethodReference = simpleClone(ifaceMethod.MethodDefinition, git);
ifaceMethodsDict[new MethodReferenceAndDeclaringTypeKey(ifaceMethodReference)] = ifaceMethod;
}
}
foreach (var classMethod in methods.getAll()) {
foreach (var classMethod in methods.getValues()) {
if (!classMethod.isVirtual())
continue;
foreach (var overrideMethod in classMethod.MethodDefinition.Overrides) {
@ -694,7 +694,7 @@ namespace de4dot.code.renamer.asmmodules {
virtualMethodInstances.initializeFrom(baseType.typeDef.virtualMethodInstances, baseType.typeReference as GenericInstanceType);
// Figure out which methods we override in the base class
foreach (var methodDef in methods.getAll()) {
foreach (var methodDef in methods.getValues()) {
if (!methodDef.isVirtual() || methodDef.isNewSlot())
continue;
var methodInstList = virtualMethodInstances.lookup(methodDef.MethodDefinition);
@ -705,7 +705,7 @@ namespace de4dot.code.renamer.asmmodules {
}
}
foreach (var methodDef in methods.getAll()) {
foreach (var methodDef in methods.getValues()) {
if (!methodDef.isVirtual())
continue;
virtualMethodInstances.add(new MethodInst(methodDef, methodDef.MethodDefinition));