コード例 #1
0
ファイル: TypeDef.cs プロジェクト: ldh0227/de4dot
 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;
     }
 }
コード例 #2
0
ファイル: TypeDef.cs プロジェクト: ldh0227/de4dot
 public TypeInfo(TypeInfo other, GenericInstanceType git)
 {
     this.typeReference = TypeReferenceInstance.make(other.typeReference, git);
     this.typeDef = other.typeDef;
 }
コード例 #3
0
ファイル: TypeDef.cs プロジェクト: ldh0227/de4dot
 public InterfaceMethodInfo(TypeInfo iface)
 {
     this.iface = iface;
     foreach (var methodDef in iface.typeDef.AllMethods)
         ifaceMethodToClassMethod[methodDef] = null;
 }
コード例 #4
0
ファイル: TypeDef.cs プロジェクト: ldh0227/de4dot
 public InterfaceMethodInfo(TypeInfo iface, InterfaceMethodInfo other)
 {
     this.iface = iface;
     foreach (var key in other.ifaceMethodToClassMethod.Keys)
         ifaceMethodToClassMethod[key] = other.ifaceMethodToClassMethod[key];
 }
コード例 #5
0
ファイル: TypeDef.cs プロジェクト: ldh0227/de4dot
 public void addBaseType(TypeDef baseDef, TypeReference baseRef)
 {
     if (baseDef == null || baseRef == null)
         return;
     baseType = new TypeInfo(baseRef, baseDef);
 }
コード例 #6
0
ファイル: TypeDef.cs プロジェクト: ldh0227/de4dot
        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;
            }
        }
コード例 #7
0
ファイル: TypeDef.cs プロジェクト: ldh0227/de4dot
 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);
 }
コード例 #8
0
ファイル: TypeDef.cs プロジェクト: ldh0227/de4dot
 // Returns the previous classMethod, or null if none
 public MethodDef addMethod(TypeInfo iface, MethodDef ifaceMethod, MethodDef classMethod)
 {
     return addMethod(iface.typeReference, ifaceMethod, classMethod);
 }
コード例 #9
0
ファイル: TypeDef.cs プロジェクト: ldh0227/de4dot
 public void addInterface(TypeInfo iface)
 {
     var key = new TypeReferenceKey(iface.typeReference);
     if (!interfaceMethods.ContainsKey(key))
         interfaceMethods[key] = new InterfaceMethodInfo(iface);
 }