| | | 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 ImportDefinition |
| | | 9 | | { |
| | 0 | 10 | | public ImportDefinitionKind Kind { get; } |
| | 0 | 11 | | public BlobHandle Alias { get; } |
| | 0 | 12 | | public AssemblyReferenceHandle TargetAssembly { get; } |
| | | 13 | | |
| | 0 | 14 | | public BlobHandle TargetNamespace => (BlobHandle)_typeOrNamespace; |
| | 0 | 15 | | public EntityHandle TargetType => (EntityHandle)_typeOrNamespace; |
| | | 16 | | private readonly Handle _typeOrNamespace; |
| | | 17 | | |
| | | 18 | | internal ImportDefinition( |
| | | 19 | | ImportDefinitionKind kind, |
| | | 20 | | BlobHandle alias = default(BlobHandle), |
| | | 21 | | AssemblyReferenceHandle assembly = default(AssemblyReferenceHandle), |
| | | 22 | | Handle typeOrNamespace = default(Handle)) |
| | 0 | 23 | | { |
| | 0 | 24 | | Debug.Assert( |
| | 0 | 25 | | typeOrNamespace.IsNil || |
| | 0 | 26 | | typeOrNamespace.Kind == HandleKind.Blob || |
| | 0 | 27 | | typeOrNamespace.Kind == HandleKind.TypeDefinition || |
| | 0 | 28 | | typeOrNamespace.Kind == HandleKind.TypeReference || |
| | 0 | 29 | | typeOrNamespace.Kind == HandleKind.TypeSpecification); |
| | | 30 | | |
| | 0 | 31 | | Kind = kind; |
| | 0 | 32 | | Alias = alias; |
| | 0 | 33 | | TargetAssembly = assembly; |
| | 0 | 34 | | _typeOrNamespace = typeOrNamespace; |
| | 0 | 35 | | } |
| | | 36 | | } |
| | | 37 | | } |
| | | 38 | | |