03.07.2007, 00:31 | #1 |
Участник
|
Issues concerning X++: Managed enumeration types and X++
Источник: http://blogs.msdn.com/x/archive/2007...pes-and-x.aspx
============== Currently it is painful to use managed enumeration types in X++, although not impossible, This example came up the other day: A user needed to access an enumeration type called PsDirectoryFilterEnum in a namespace called ProductStudio. He wanted to assign the value PsDirectoryFilterEnum.psDirectoryFilterPSProducts to some variable. Currently the only wat of doing this is by using the following code using parseClrEnum supplying both the name of the enumeration type and the enumeration literal as strings: [FONT='Arial','sans-serif']ProductStudio.PsDirectoryFilterEnum psDirEnum = [/FONT][FONT='Arial','sans-serif']ClrInterop::parseClrEnum('ProductStudio.PsDirectoryrFilterEnum', 'psDirectoryFilterPSProducts');[/FONT] [FONT='Arial','sans-serif']At some point in the future we'll probably allow the user to declare enumerations more naturally, like[/FONT] [FONT='Arial','sans-serif']ProductStudio.PsDirectoryrFilterEnum enum = [FONT='Arial','sans-serif']ProductStudio.[/FONT]PsDirectoryrFilterEnum::psDirectoryFilterPSProducts;[/FONT] [FONT='Arial','sans-serif']using the familiar double colon syntax to access the enumeration literal, just as if it had been a normal X++ enumeration.[/FONT] Источник: http://blogs.msdn.com/x/archive/2007...pes-and-x.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|