Documentation for Ice 3.5. The latest release is Ice 3.7. Refer to the space directory for other releases.

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

  • No labels