Beispiel #1
0
 public InterfaceMethodInfo(TypeInfo iface, InterfaceMethodInfo other)
 {
     this.iface = iface;
     foreach (var key in other.ifaceMethodToClassMethod.Keys)
     {
         ifaceMethodToClassMethod[key] = other.ifaceMethodToClassMethod[key];
     }
 }
Beispiel #2
0
        public void AddInterface(TypeInfo iface)
        {
            var key = iface.typeRef;

            if (!interfaceMethods.ContainsKey(key))
            {
                interfaceMethods[key] = new InterfaceMethodInfo(iface);
            }
        }
Beispiel #3
0
 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];
     }
 }
Beispiel #4
0
        public void InitializeFrom(InterfaceMethodInfos other, GenericInstSig git)
        {
            foreach (var pair in other.interfaceMethods)
            {
                var oldTypeInfo = pair.Value.IFace;
                var newTypeInfo = new TypeInfo(oldTypeInfo, git);
                var oldKey      = oldTypeInfo.typeRef;
                var newKey      = newTypeInfo.typeRef;

                InterfaceMethodInfo newMethodsInfo = new InterfaceMethodInfo(newTypeInfo, other.interfaceMethods[oldKey]);
                if (interfaceMethods.ContainsKey(newKey))
                {
                    newMethodsInfo.Merge(interfaceMethods[newKey]);
                }
                interfaceMethods[newKey] = newMethodsInfo;
            }
        }
Beispiel #5
0
 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];
     }
 }
Beispiel #6
0
 public InterfaceMethodInfo(TypeInfo iface, InterfaceMethodInfo other)
 {
     this.iface = iface;
     foreach (var key in other.ifaceMethodToClassMethod.Keys)
         ifaceMethodToClassMethod[key] = other.ifaceMethodToClassMethod[key];
 }
Beispiel #7
0
        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;
            }
        }
Beispiel #8
0
 public void addInterface(TypeInfo iface)
 {
     var key = new TypeReferenceKey(iface.typeReference);
     if (!interfaceMethods.ContainsKey(key))
         interfaceMethods[key] = new InterfaceMethodInfo(iface);
 }