Enums

From $1

Table of contents
No headers

Enums map onto Ruby classes, so using them is just like using any .NET class:

>>> require 'System.Windows.Forms'
=> true
>>> include System::Windows::Forms
=> Object
>>> AnchorStyles
=> System::Windows::Forms::AnchorStyles
>>> System::Enum.GetNames(AnchorStyles.to_clr_type)
=> ['None', 'Top', 'Bottom', 'Left', 'Right']
>>> AnchorStyles.bottom
=> Bottom

They can also be xor'd together

>>> AnchorStyles.bottom | AnchorStyles.left
=> Bottom, Left

Note: make sure not to use the "or" operator (||), as that will only give you back the first Enum value

Tags:
 
Images (0)
 
Comments (0)
You must login to post a comment.

 
SourceForge.net