Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Znav
nextC-Sharp Mapping for Structures
prevC-Sharp Mapping for Built-In Types

A Slice enumeration maps to the corresponding enumeration in C#. For example:

Wiki Markup
{zcode:slice}
enum Fruit { Apple, Pear, Orange };
{zcode}

Not surprisingly, the generated C# definition is very similar:

Wiki Markup
{zcode:cs}
public enum Fruit { Apple, Pear, Orange }
{zcode}

Suppose we modify the Slice definition to include a custom enumerator value:

Wiki Markup
{zcode:slice}
enum Fruit { Apple, Pear = 3, Orange };
{zcode}

The generated C# definition now includes an explicit initializer for every enumerator:

Wiki Markup
{zcode:cs}
public enum Fruit { Apple = 0, Pear = 3, Orange = 4 }
{zcode}

Ztop

See Also

Zret
Znav
nextC-Sharp Mapping for Structures
prevC-Sharp Mapping for Built-In Types