public void merge(InterfaceMethodInfo other) { foreach (var key in other.ifaceMethodToClassMethod.Keys) { if (other.ifaceMethodToClassMethod[key] == null) continue; if (ifaceMethodToClassMethod[key] != null) throw new ApplicationException("Interface method already initialized"); ifaceMethodToClassMethod[key] = other.ifaceMethodToClassMethod[key]; } }
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 InterfaceMethodInfo(TypeInfo iface, InterfaceMethodInfo other) { this.iface = iface; foreach (var key in other.ifaceMethodToClassMethod.Keys) ifaceMethodToClassMethod[key] = other.ifaceMethodToClassMethod[key]; }
public void addInterface(TypeInfo iface) { var key = new TypeReferenceKey(iface.typeReference); if (!interfaceMethods.ContainsKey(key)) interfaceMethods[key] = new InterfaceMethodInfo(iface); }