public TypeReferenceCount GetBaseClasses() { var types = new TypeReferenceCount(); if (type.BaseType != null) { types.Add(new Type(type.BaseType, cache)); } return types; }
public TypeReferenceCount GetBaseTypes() { var types = new TypeReferenceCount { GetBaseClasses(), GetInterfaces() }; return types; }
public TypeReferenceCount GetTypeReferences() { var types = new TypeReferenceCount(); foreach (var parameter in GetParameters()) { types.Add(parameter); } types.Add(GetBodyReferences()); return types; }
public TypeReferenceCount GetInterfaces() { var types = new TypeReferenceCount(); if (type.Interfaces != null) { foreach (var @interface in type.Interfaces) { types.Add(new Type(@interface, cache)); } } return types; }
public TypeReferenceCount GetBodyReferences() { var types = new TypeReferenceCount(); if (method.HasBody && method.Body != null) { foreach (var variable in GetMethodBodyVariables(method)) { types.Add(variable); } foreach (var instruction in method.Body.Instructions) { var operand = instruction.Operand; if (operand != null) { var operandProcessors = new IOperandType[] { new MemberReferenceType(operand), new ParameterDefinitionType(operand), new VariableDefinitionType(operand), new PrimitiveType(operand), }; foreach (var operandProcessor in operandProcessors) { var type = operandProcessor.GetOperandType(); if (type != null) { types.Add(type); break; } } } } } return types; }