Example #1
0
 public MethodDef(MethodDefinition methodDefinition, TypeDef owner, int index)
     : base(methodDefinition, owner, index)
 {
     genericParams = GenericParamDef.createGenericParamDefList(MethodDefinition.GenericParameters);
     for (int i = 0; i < methodDefinition.Parameters.Count; i++) {
         var param = methodDefinition.Parameters[i];
         paramDefs.Add(new ParamDef(param, i));
     }
 }
Example #2
0
 public EventDef(EventDefinition eventDefinition, TypeDef owner, int index)
     : base(eventDefinition, owner, index)
 {
 }
Example #3
0
        TypeDef resolveOther(TypeReference type)
        {
            if (type == null)
                return null;
            type = type.GetElementType();

            TypeDef typeDef;
            var key = new TypeReferenceKey(type);
            if (otherTypesDict.TryGetValue(key, out typeDef))
                return typeDef;
            otherTypesDict[key] = null;	// In case of a circular reference

            TypeDefinition typeDefinition = externalAssemblies.resolve(type);
            if (typeDefinition == null)
                return null;

            typeDef = new TypeDef(typeDefinition, null, 0);
            typeDef.addMembers();
            foreach (var iface in typeDef.TypeDefinition.Interfaces) {
                var ifaceDef = resolveOther(iface);
                if (ifaceDef == null)
                    continue;
                typeDef.addInterface(ifaceDef, iface);
            }
            var baseDef = resolveOther(typeDef.TypeDefinition.BaseType);
            if (baseDef != null)
                typeDef.addBaseType(baseDef, typeDef.TypeDefinition.BaseType);
            return otherTypesDict[key] = typeDef;
        }
Example #4
0
 protected Ref(MemberReference memberReference, TypeDef owner, int index)
 {
     this.memberReference = memberReference;
     Owner = owner;
     Index = index;
 }
Example #5
0
 public TypeInfo(TypeInfo other, GenericInstanceType git)
 {
     this.typeReference = TypeReferenceInstance.make(other.typeReference, git);
     this.typeDef = other.typeDef;
 }
Example #6
0
 public TypeInfo(TypeReference typeReference, TypeDef typeDef)
 {
     this.typeReference = typeReference;
     this.typeDef = typeDef;
 }
Example #7
0
 public void addInterface(TypeDef ifaceDef, TypeReference iface)
 {
     if (ifaceDef == null || iface == null)
         return;
     interfaces.Add(new TypeInfo(iface, ifaceDef));
 }
Example #8
0
 public void addBaseType(TypeDef baseDef, TypeReference baseRef)
 {
     if (baseDef == null || baseRef == null)
         return;
     baseType = new TypeInfo(baseRef, baseDef);
 }
Example #9
0
 public void add(TypeDef t)
 {
     types.add(t);
 }
Example #10
0
 public FieldDef(FieldDefinition fieldDefinition, TypeDef owner, int index)
     : base(fieldDefinition, owner, index)
 {
 }
Example #11
0
 public PropertyDef(PropertyDefinition propertyDefinition, TypeDef owner, int index)
     : base(propertyDefinition, owner, index)
 {
 }