public TypeInfo(TypeInfo other, GenericInstanceType git) { this.typeReference = TypeReferenceInstance.make(other.typeReference, git); this.typeDef = other.typeDef; }
public InterfaceMethodInfo(TypeInfo iface, InterfaceMethodInfo other) { this.iface = iface; foreach (var key in other.ifaceMethodToClassMethod.Keys) ifaceMethodToClassMethod[key] = other.ifaceMethodToClassMethod[key]; }
void initializeInterfaces(TypeInfo typeInfo) { var git = typeInfo.typeReference as GenericInstanceType; interfaceMethodInfos.initializeFrom(typeInfo.typeDef.interfaceMethodInfos, git); foreach (var info in typeInfo.typeDef.allImplementedInterfaces.Keys) { var newTypeInfo = new TypeInfo(info, git); allImplementedInterfaces[newTypeInfo] = true; } }
public void addBaseType(TypeDef baseDef, TypeReference baseRef) { if (baseDef == null || baseRef == null) return; baseType = new TypeInfo(baseRef, baseDef); }
public InterfaceMethodInfo(TypeInfo iface) { this.iface = iface; foreach (var methodDef in iface.typeDef.AllMethods) ifaceMethodToClassMethod[methodDef] = null; }
public void addMethodIfEmpty(TypeInfo iface, MethodDef ifaceMethod, MethodDef classMethod) { InterfaceMethodInfo info; var key = new TypeReferenceKey(iface.typeReference); if (!interfaceMethods.TryGetValue(key, out info)) throw new ApplicationException("Could not find interface"); info.addMethodIfEmpty(ifaceMethod, classMethod); }
public void initializeFrom(InterfaceMethodInfos other, GenericInstanceType git) { foreach (var pair in other.interfaceMethods) { var oldTypeInfo = pair.Value.IFace; var newTypeInfo = new TypeInfo(oldTypeInfo, git); var oldKey = new TypeReferenceKey(oldTypeInfo.typeReference); var newKey = new TypeReferenceKey(newTypeInfo.typeReference); InterfaceMethodInfo newMethodsInfo = new InterfaceMethodInfo(newTypeInfo, other.interfaceMethods[oldKey]); if (interfaceMethods.ContainsKey(newKey)) newMethodsInfo.merge(interfaceMethods[newKey]); interfaceMethods[newKey] = newMethodsInfo; } }
public void addInterface(TypeInfo iface) { var key = new TypeReferenceKey(iface.typeReference); if (!interfaceMethods.ContainsKey(key)) interfaceMethods[key] = new InterfaceMethodInfo(iface); }
// Returns the previous classMethod, or null if none public MethodDef addMethod(TypeInfo iface, MethodDef ifaceMethod, MethodDef classMethod) { return addMethod(iface.typeReference, ifaceMethod, classMethod); }
void InitializeInterfaces(TypeInfo typeInfo) { var git = typeInfo.typeRef.TryGetGenericInstSig(); interfaceMethodInfos.InitializeFrom(typeInfo.typeDef.interfaceMethodInfos, git); foreach (var info in typeInfo.typeDef.allImplementedInterfaces.Keys) { var newTypeInfo = new TypeInfo(info, git); allImplementedInterfaces[newTypeInfo] = true; } }
public TypeInfo(TypeInfo other, GenericInstSig git) { this.typeRef = GenericArgsSubstitutor.Create(other.typeRef, git); this.typeDef = other.typeDef; }
public void AddBaseType(MTypeDef baseDef, ITypeDefOrRef baseRef) { if (baseDef == null || baseRef == null) return; baseType = new TypeInfo(baseRef, baseDef); }
public void AddMethodIfEmpty(TypeInfo iface, MMethodDef ifaceMethod, MMethodDef classMethod) { InterfaceMethodInfo info; if (!interfaceMethods.TryGetValue(iface.typeRef, out info)) throw new ApplicationException("Could not find interface"); info.AddMethodIfEmpty(ifaceMethod, classMethod); }
// Returns the previous classMethod, or null if none public MMethodDef AddMethod(TypeInfo iface, MMethodDef ifaceMethod, MMethodDef classMethod) { return AddMethod(iface.typeRef, ifaceMethod, classMethod); }