private void PopulateTypeDef() { if (typeDefs == null) { typeDefs = new TypeDefImpl[TypeDef.records.Length]; for (int i = 0; i < typeDefs.Length; i++) { TypeDefImpl type = new TypeDefImpl(this, i); typeDefs[i] = type; if (type.IsModulePseudoType) { moduleType = type; } else if (!type.IsNestedByFlags) { types.Add(new TypeName(type.__Namespace, type.__Name), type); } } // add forwarded types to forwardedTypes dictionary (because Module.GetType(string) should return them) for (int i = 0; i < ExportedType.records.Length; i++) { int implementation = ExportedType.records[i].Implementation; if (implementation >> 24 == AssemblyRefTable.Index) { TypeName typeName = GetTypeName(ExportedType.records[i].TypeNamespace, ExportedType.records[i].TypeName); forwardedTypes.Add(typeName, new LazyForwardedType((implementation & 0xFFFFFF) - 1)); } } } }
internal FieldInfo GetFieldAt(TypeDefImpl owner, int index) { if (fields == null) { fields = new FieldInfo[Field.records.Length]; } if (fields[index] == null) { fields[index] = new FieldDefImpl(this, owner ?? FindFieldOwner(index), index); } return(fields[index]); }
internal MethodBase GetMethodAt(TypeDefImpl owner, int index) { if (methods == null) { methods = new MethodBase[MethodDef.records.Length]; } if (methods[index] == null) { MethodDefImpl method = new MethodDefImpl(this, owner ?? FindMethodOwner(index), index); methods[index] = method.IsConstructor ? new ConstructorInfoImpl(method) : (MethodBase)method; } return(methods[index]); }
internal FieldDefImpl(ModuleReader module, TypeDefImpl declaringType, int index) { this.module = module; this.declaringType = declaringType; this.index = index; }
internal MethodBase GetMethodAt(TypeDefImpl owner, int index) { if (methods == null) { methods = new MethodBase[MethodDef.records.Length]; } if (methods[index] == null) { MethodDefImpl method = new MethodDefImpl(this, owner ?? FindMethodOwner(index), index); methods[index] = method.IsConstructor ? new ConstructorInfoImpl(method) : (MethodBase)method; } return methods[index]; }
internal FieldInfo GetFieldAt(TypeDefImpl owner, int index) { if (fields == null) { fields = new FieldInfo[Field.records.Length]; } if (fields[index] == null) { fields[index] = new FieldDefImpl(this, owner ?? FindFieldOwner(index), index); } return fields[index]; }
private void PopulateTypeDef() { if (typeDefs == null) { typeDefs = new TypeDefImpl[TypeDef.records.Length]; for (int i = 0; i < typeDefs.Length; i++) { TypeDefImpl type = new TypeDefImpl(this, i); typeDefs[i] = type; if (type.IsModulePseudoType) { moduleType = type; } else if (!type.IsNestedByFlags) { types.Add(new TypeName(type.__Namespace, type.__Name), type); } } // add forwarded types to forwardedTypes dictionary (because Module.GetType(string) should return them) for (int i = 0; i < ExportedType.records.Length; i++) { int implementation = ExportedType.records[i].Implementation; if (implementation >> 24 == AssemblyRefTable.Index) { TypeName typeName = GetTypeName(ExportedType.records[i].TypeNamespace, ExportedType.records[i].TypeName); forwardedTypes.Add(typeName, new LazyForwardedType(i)); } } } }
internal MethodDefImpl(ModuleReader module, TypeDefImpl declaringType, int index) { this.module = module; this.index = index; this.declaringType = declaringType; }