예제 #1
0
 public TypeInfo(TypeInfo other, GenericInstanceType git)
 {
     this.typeReference = TypeReferenceInstance.make(other.typeReference, git);
     this.typeDef = other.typeDef;
 }
예제 #2
0
 public InterfaceMethodInfo(TypeInfo iface, InterfaceMethodInfo other)
 {
     this.iface = iface;
     foreach (var key in other.ifaceMethodToClassMethod.Keys)
         ifaceMethodToClassMethod[key] = other.ifaceMethodToClassMethod[key];
 }
예제 #3
0
 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;
     }
 }
예제 #4
0
 public void addBaseType(TypeDef baseDef, TypeReference baseRef)
 {
     if (baseDef == null || baseRef == null)
         return;
     baseType = new TypeInfo(baseRef, baseDef);
 }
예제 #5
0
 public InterfaceMethodInfo(TypeInfo iface)
 {
     this.iface = iface;
     foreach (var methodDef in iface.typeDef.AllMethods)
         ifaceMethodToClassMethod[methodDef] = null;
 }
예제 #6
0
 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);
 }
예제 #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;
            }
        }
예제 #8
0
 public void addInterface(TypeInfo iface)
 {
     var key = new TypeReferenceKey(iface.typeReference);
     if (!interfaceMethods.ContainsKey(key))
         interfaceMethods[key] = new InterfaceMethodInfo(iface);
 }
예제 #9
0
 // Returns the previous classMethod, or null if none
 public MethodDef addMethod(TypeInfo iface, MethodDef ifaceMethod, MethodDef classMethod)
 {
     return addMethod(iface.typeReference, ifaceMethod, classMethod);
 }
예제 #10
0
		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;
			}
		}
예제 #11
0
		public TypeInfo(TypeInfo other, GenericInstSig git) {
			this.typeRef = GenericArgsSubstitutor.Create(other.typeRef, git);
			this.typeDef = other.typeDef;
		}
예제 #12
0
		public void AddBaseType(MTypeDef baseDef, ITypeDefOrRef baseRef) {
			if (baseDef == null || baseRef == null)
				return;
			baseType = new TypeInfo(baseRef, baseDef);
		}
예제 #13
0
		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);
		}
예제 #14
0
		// Returns the previous classMethod, or null if none
		public MMethodDef AddMethod(TypeInfo iface, MMethodDef ifaceMethod, MMethodDef classMethod) {
			return AddMethod(iface.typeRef, ifaceMethod, classMethod);
		}