| | | 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.Collections.Immutable; |
| | | 5 | | using System.Diagnostics; |
| | | 6 | | using System.Reflection.Metadata.Ecma335; |
| | | 7 | | |
| | | 8 | | namespace System.Reflection.Metadata |
| | | 9 | | { |
| | | 10 | | public struct NamespaceDefinition |
| | | 11 | | { |
| | | 12 | | private readonly NamespaceData _data; |
| | | 13 | | |
| | | 14 | | internal NamespaceDefinition(NamespaceData data) |
| | 0 | 15 | | { |
| | 0 | 16 | | Debug.Assert(data != null); |
| | 0 | 17 | | _data = data; |
| | 0 | 18 | | } |
| | | 19 | | |
| | | 20 | | /// <summary> |
| | | 21 | | /// Gets the unqualified name of the NamespaceDefinition. |
| | | 22 | | /// </summary> |
| | | 23 | | public StringHandle Name |
| | | 24 | | { |
| | 0 | 25 | | get { return _data.Name; } |
| | | 26 | | } |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// Gets the parent namespace. |
| | | 30 | | /// </summary> |
| | | 31 | | public NamespaceDefinitionHandle Parent |
| | | 32 | | { |
| | 0 | 33 | | get { return _data.Parent; } |
| | | 34 | | } |
| | | 35 | | |
| | | 36 | | /// <summary> |
| | | 37 | | /// Gets the namespace definitions that are direct children of the current |
| | | 38 | | /// namespace definition. |
| | | 39 | | /// |
| | | 40 | | /// System.Collections and System.Linq are direct children of System. |
| | | 41 | | /// System.Collections.Generic is a direct child of System.Collections. |
| | | 42 | | /// System.Collections.Generic is *not* a direct child of System. |
| | | 43 | | /// </summary> |
| | | 44 | | public ImmutableArray<NamespaceDefinitionHandle> NamespaceDefinitions |
| | | 45 | | { |
| | 0 | 46 | | get { return _data.NamespaceDefinitions; } |
| | | 47 | | } |
| | | 48 | | |
| | | 49 | | /// <summary> |
| | | 50 | | /// Gets all type definitions that reside directly in a namespace. |
| | | 51 | | /// </summary> |
| | | 52 | | public ImmutableArray<TypeDefinitionHandle> TypeDefinitions |
| | | 53 | | { |
| | 0 | 54 | | get { return _data.TypeDefinitions; } |
| | | 55 | | } |
| | | 56 | | |
| | | 57 | | /// <summary> |
| | | 58 | | /// Gets all exported types that reside directly in a namespace. |
| | | 59 | | /// </summary> |
| | | 60 | | public ImmutableArray<ExportedTypeHandle> ExportedTypes |
| | | 61 | | { |
| | 0 | 62 | | get { return _data.ExportedTypes; } |
| | | 63 | | } |
| | | 64 | | } |
| | | 65 | | } |
| | | 66 | | |