using System;
namespace AnticipatingMinds.Genesis.CodeDOM{
/// <summary>
/// Represents declaration of an 'enum' type.
/// </summary>
/// <remarks>
/// An enum type is a distinct type that declares a set of named constants.
/// (ECMA 334. Page 297, Line 1)
/// </remarks>
[Serializable()]
public class CodeEnumDeclaration : CodeTypeDeclaration
{
#region Instance constructors
/// <summary>
/// Initializes new instance of the <see cref="CodeEnumDeclaration"/> class.
/// </summary>
public CodeEnumDeclaration():base(){}
#endregion Instance constructors
#region Public instance properties
/// <summary>
/// Gets or sets underlying enum type.
/// </summary>
/// <remarks>
/// Each enum type has a corresponding integral type called the underlying type of the enum type.
/// This underlying type must be able to represent all the enumerator values defined in the
/// enumeration. An enum declaration may explicitly declare an underlying type of byte,
/// sbyte, short, ushort, int, uint, long or ulong. An enum declaration that does not
/// explicitly declare an underlying type has an underlying type of int.
/// (ECMA 334. Page 297, Line 20)
/// </remarks>
public CodeTypeReference EnumBase
{
get
{
return enumBase;
}
set
{
enumBase = value;
}
}
/// <summary>
/// Gets a collection of 'enum' declared constants.
/// </summary>
public CodeEnumMemberCollection Members
{
get
{
return members;
}
}
#endregion Public instance properties
#region Private instance fields
private CodeEnumMemberCollection members = new CodeEnumMemberCollection();
private CodeTypeReference enumBase = new CodeTypeReference(typeof(int));
#endregion Private instance fields
}
}
|