| | | 1 | | // Licensed to the .NET Foundation under one or more agreements. |
| | | 2 | | // The .NET Foundation licenses this file to you under the MIT license. |
| | | 3 | | |
| | | 4 | | using System.Diagnostics; |
| | | 5 | | |
| | | 6 | | namespace System.Reflection.Metadata |
| | | 7 | | { |
| | | 8 | | public readonly struct ModuleDefinition |
| | | 9 | | { |
| | | 10 | | private readonly MetadataReader _reader; |
| | | 11 | | |
| | | 12 | | internal ModuleDefinition(MetadataReader reader) |
| | 0 | 13 | | { |
| | 0 | 14 | | Debug.Assert(reader != null); |
| | 0 | 15 | | _reader = reader; |
| | 0 | 16 | | } |
| | | 17 | | |
| | | 18 | | public int Generation |
| | | 19 | | { |
| | | 20 | | get |
| | 0 | 21 | | { |
| | 0 | 22 | | return _reader.ModuleTable.GetGeneration(); |
| | 0 | 23 | | } |
| | | 24 | | } |
| | | 25 | | |
| | | 26 | | public StringHandle Name |
| | | 27 | | { |
| | | 28 | | get |
| | 0 | 29 | | { |
| | 0 | 30 | | return _reader.ModuleTable.GetName(); |
| | 0 | 31 | | } |
| | | 32 | | } |
| | | 33 | | |
| | | 34 | | public GuidHandle Mvid |
| | | 35 | | { |
| | | 36 | | get |
| | 0 | 37 | | { |
| | 0 | 38 | | return _reader.ModuleTable.GetMvid(); |
| | 0 | 39 | | } |
| | | 40 | | } |
| | | 41 | | |
| | | 42 | | public GuidHandle GenerationId |
| | | 43 | | { |
| | | 44 | | get |
| | 0 | 45 | | { |
| | 0 | 46 | | return _reader.ModuleTable.GetEncId(); |
| | 0 | 47 | | } |
| | | 48 | | } |
| | | 49 | | |
| | | 50 | | public GuidHandle BaseGenerationId |
| | | 51 | | { |
| | | 52 | | get |
| | 0 | 53 | | { |
| | 0 | 54 | | return _reader.ModuleTable.GetEncBaseId(); |
| | 0 | 55 | | } |
| | | 56 | | } |
| | | 57 | | |
| | | 58 | | public CustomAttributeHandleCollection GetCustomAttributes() |
| | 0 | 59 | | { |
| | 0 | 60 | | return new CustomAttributeHandleCollection(_reader, EntityHandle.ModuleDefinition); |
| | 0 | 61 | | } |
| | | 62 | | } |
| | | 63 | | } |
| | | 64 | | |