private AssemblyDefinitionHandle Import()

in src/Refasmer/Importer/SimpleImports.cs [120:216]


    private AssemblyDefinitionHandle Import(AssemblyDefinitionHandle srcHandle) =>
        srcHandle == EntityHandle.AssemblyDefinition
            ? EntityHandle.AssemblyDefinition
            : throw new ArgumentException("Invalid assembly definition handle");

    private ModuleDefinitionHandle Import(ModuleDefinitionHandle srcHandle) =>
        srcHandle == EntityHandle.ModuleDefinition ? EntityHandle.ModuleDefinition :
            throw new ArgumentException("Invalid module definition handle");

    //------------------

    private EntityHandle Import( EntityHandle srcHandle )
    {
        if (srcHandle.IsNil)
            return srcHandle;

        switch (srcHandle.Kind)
        {
            case HandleKind.TypeDefinition:
                return Import((TypeDefinitionHandle) srcHandle);
            case HandleKind.FieldDefinition:
                return Import((FieldDefinitionHandle) srcHandle);
            case HandleKind.MethodDefinition:
                return Import((MethodDefinitionHandle) srcHandle);
            case HandleKind.Parameter:
                return Import((ParameterHandle) srcHandle);
            case HandleKind.InterfaceImplementation:
                return Import((InterfaceImplementationHandle) srcHandle);
            case HandleKind.EventDefinition:
                return Import((EventDefinitionHandle) srcHandle);
            case HandleKind.PropertyDefinition:
                return Import((PropertyDefinitionHandle) srcHandle);
            case HandleKind.GenericParameter:
                return Import((GenericParameterHandle) srcHandle);
            case HandleKind.GenericParameterConstraint:
                return Import((GenericParameterConstraintHandle) srcHandle);
            case HandleKind.TypeReference:
                return Import((TypeReferenceHandle) srcHandle);
            case HandleKind.MemberReference:
                return Import((MemberReferenceHandle) srcHandle);
            case HandleKind.AssemblyReference:
                return Import((AssemblyReferenceHandle) srcHandle);
            case HandleKind.AssemblyFile:
                return Import((AssemblyFileHandle) srcHandle);
            case HandleKind.MethodImplementation:
                return Import((MethodImplementationHandle) srcHandle);

            case HandleKind.ExportedType:
                return Import((ExportedTypeHandle) srcHandle);
            case HandleKind.CustomAttribute:
                return Import((CustomAttributeHandle) srcHandle);
            case HandleKind.DeclarativeSecurityAttribute:
                return Import((DeclarativeSecurityAttributeHandle) srcHandle);
            case HandleKind.ModuleReference:
                return Import((ModuleReferenceHandle) srcHandle);
            case HandleKind.TypeSpecification:
                return Import((TypeSpecificationHandle) srcHandle);

            //Globals
            case HandleKind.ModuleDefinition:
                return Import((ModuleDefinitionHandle) srcHandle);
            case HandleKind.AssemblyDefinition:
                return Import((AssemblyDefinitionHandle) srcHandle);

            //Not supported
            case HandleKind.MethodSpecification:
                break;
            case HandleKind.ManifestResource:
                break;
            case HandleKind.Constant:
                break;
            case HandleKind.StandaloneSignature:
                break;
            case HandleKind.Document:
                break;
            case HandleKind.MethodDebugInformation:
                break;
            case HandleKind.LocalScope:
                break;
            case HandleKind.LocalVariable:
                break;
            case HandleKind.LocalConstant:
                break;
            case HandleKind.ImportScope:
                break;
            case HandleKind.CustomDebugInformation:
                break;
            case HandleKind.UserString:
                break;
            case HandleKind.NamespaceDefinition:
                break;
            default:
                throw new ArgumentOutOfRangeException();
        }

        throw new NotImplementedException();
    }