Importing Enums

Posts   
 
    
rsiera
User
Posts: 48
Joined: 09-Oct-2011
# Posted on: 16-Jun-2017 11:27:50   

I can't get to import enums. I'm using v5.2 I created enum.typeimports file.


<typeImports>
    <typeImport typeName="Company.Project.TypeConverters.PaymentTransaction.SourceType" assemblyFile="C:\....\Company.Project.TypeConverters.dll"/> 
    <typeImport typeName="Company.Project.TypeConverters.PaymentTransaction.Status" assemblyFile="C:\....\Company.Project.TypeConverters.dll"/> 
</typeImports>

which has


namespace Company.Project.TypeConverters
{
    public struct PaymentTransaction
    {
        public enum SourceType
        {
            Undefined = 0,
            Cart,
            Invoice
        }

        public enum Status
        {
            Undefined = 0,
            Cancelled,
            Completed
        }
    }
}

I added the folder with the enum.typeimports file as additional type converter folder.

When I re-scan for typeimports files there is no logging at all in the Application Output window (verbose enabled)

"View loaded external types" doesn't mention the enums.

Shouldn't the Application Output window at least mention the detection of the .typeimports file? Please advise.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 17-Jun-2017 07:38:55   

Maybe it it didn't show up in the ApplicationOutput because it didn't find any candidate for types to import.

Could you please try to change to "class" instead of "struct"? Any particular reason why you use struct?

David Elizondo | LLBLGen Support Team