public ShallowTypeCollection(ModuleDefinition owner, TypeDefinitionTable table) : base(owner) { if (table == null) throw new ArgumentNullException("table"); _table = table; }
private void AddDummyType(TypeDefinitionTable typeTable, FieldDefinitionTable fieldTable, MethodDefinitionTable methodTable, TypeDefinition type) { // Add dummy type. var typeRow = new MetadataRow <TypeAttributes, uint, uint, uint, uint, uint> { Column1 = type.Attributes, Column2 = _parentBuffer.StringStreamBuffer.GetStringOffset(type.Name), Column3 = _parentBuffer.StringStreamBuffer.GetStringOffset(type.Namespace), Column4 = 0, // BaseType Column5 = _fieldList, Column6 = _methodList }; typeTable.Add(typeRow); _members.Add(type, typeRow.MetadataToken); // Add dummy fields. foreach (var field in type.Fields) { AddDummyField(fieldTable, field); } _fieldList += (uint)type.Fields.Count; // Add dummy methods. foreach (var method in type.Methods) { AddDummyMethod(methodTable, method); } _methodList += (uint)type.Methods.Count; }
internal ShallowTypeCollection(ModuleDefinition owner, TypeDefinitionTable table, ICollection <uint> topLevelTypeTokens) : base(owner) { _typeTable = table ?? throw new ArgumentNullException(nameof(table)); _topLevelTypeTokens = topLevelTypeTokens; }