C# 2.0 Enums

Enums are sets of named constants. PowerDesigner models enums as classes with a stereotype of <<Enum>>.



{
 public enum Color : colors
 {
  Red,
  Blue,
  Green,
  Max = Blue
 }
}

For information about creating and working with classes, see Classes (OOM).

Creating an Enum

You can create an enum in any of the following ways:
  • Use the Enum tool in the C# 2.0 Toolbox.

  • Select Model > Enum Objects to access the List of Enum Objects, and click the Add a Row tool.

  • Right-click the model (or a package) in the Browser, and select New > Enum.

Enum Properties

C# Enum property sheets contain all the standard class tabs along with the C# tab, the properties of which are listed below:

Property

Description

Base Integral Type

Specifies the base integral type for the enum.

New

Specifies the new modifier for the enum declaration.