[IronPython] how to use an enum from a hosted script

Ernesto Cullen ecullen at fibertel.com.ar
Thu Feb 19 18:25:57 CET 2009

hi all,  
    I have IronPython hosted inside a c# project, and all goes well... 
until now when i want to use an enum c# type inside a script. For 
instance, I have in C# this declaration:

public enum NotificationTypeEnum {Main,Detail}

Then in a script I want to use this enum in an assignment:

NotifMessage('some message', NotificationTypeEnum.Main)

Where NotifMessage is a delegate expecting a string and a 
NotificationTypeEnum. When I try to run this script, IPy says that it 
does not know NotificationTypeEnum. I tried to add an Import but i get 
'Imports are disabled'.
Any ideas on how to pass this enumeration to a script? I am using IPy 1.1.


Ernesto Cullen

More information about the Ironpython-users mailing list