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

2009-02-20 Thread Ernesto Cullen
Thanks all, I have found the culprit: we use a home-modified version of IPy and one of the modifications was... to disable all import from scripts for security reasons. I have tried with the original version and it worked like a charm. I will have to think in some workaround for the time being

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

2009-02-19 Thread Ernesto Cullen
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:

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

2009-02-19 Thread Michael Foord
Dino Viehland wrote: Generally what you'd do is: import clr clr.AddReference('yourdll') from MyNamespace import NotificationTypeEnum I have no idea where the 'Imports are disabled' exception would come from though. If you could include the actual text of the exception that might be helpful.

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

2009-02-19 Thread Dino Viehland
Woops :) Yes, setting EngineOptions.ExceptionDetail may be more useful (depending on who's catching and printing the exception I guess). -Original Message- From: users-boun...@lists.ironpython.com [mailto:users- boun...@lists.ironpython.com] On Behalf Of Michael Foord Sent: