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)); } }
public EventDef(EventDefinition eventDefinition, TypeDef owner, int index) : base(eventDefinition, owner, index) { }
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; }
protected Ref(MemberReference memberReference, TypeDef owner, int index) { this.memberReference = memberReference; Owner = owner; Index = index; }
public TypeInfo(TypeInfo other, GenericInstanceType git) { this.typeReference = TypeReferenceInstance.make(other.typeReference, git); this.typeDef = other.typeDef; }
public TypeInfo(TypeReference typeReference, TypeDef typeDef) { this.typeReference = typeReference; this.typeDef = typeDef; }
public void addInterface(TypeDef ifaceDef, TypeReference iface) { if (ifaceDef == null || iface == null) return; interfaces.Add(new TypeInfo(iface, ifaceDef)); }
public void addBaseType(TypeDef baseDef, TypeReference baseRef) { if (baseDef == null || baseRef == null) return; baseType = new TypeInfo(baseRef, baseDef); }
public void add(TypeDef t) { types.add(t); }
public FieldDef(FieldDefinition fieldDefinition, TypeDef owner, int index) : base(fieldDefinition, owner, index) { }
public PropertyDef(PropertyDefinition propertyDefinition, TypeDef owner, int index) : base(propertyDefinition, owner, index) { }