A Slice enumeration maps to the corresponding enumeration in C#. For example:
Slice
enum Fruit { Apple, Pear, Orange };
Not surprisingly, the generated C# definition is very similar:
C#
public enum Fruit { Apple, Pear, Orange }
Suppose we modify the Slice definition to include a custom enumerator value:
Slice
enum Fruit { Apple, Pear = 3, Orange };
The generated C# definition now includes an explicit initializer for every enumerator:
C#
public enum Fruit { Apple = 0, Pear = 3, Orange = 4 }
See Also
- C-Sharp Mapping for Identifiers
- C-Sharp Mapping for Modules
- C-Sharp Mapping for Built-In Types
- C-Sharp Mapping for Structures
- C-Sharp Mapping for Sequences
- C-Sharp Mapping for Dictionaries
- C-Sharp Collection Comparison
- C-Sharp Mapping for Constants
- C-Sharp Mapping for Exceptions