Open sandboxFocus

Interface IEnumBuilder

Allows to complete the construction of an enum that has been created by the IntroduceEnum(IAdviser<INamespaceOrNamedType>, string, Action<IEnumBuilder>, OverrideStrategy) advice.

Namespace: Metalama.Framework.Code.DeclarationBuilders
Assembly: Metalama.Framework.dll
Syntax
[InternalImplement]
public interface IEnumBuilder : IMemberOrNamedTypeBuilder, IMemberOrNamedType, INamedDeclaration, IDeclarationBuilder, IDeclaration, IDisplayable, IDiagnosticLocation, ICompilationElement, IMeasurable, IEquatable<IDeclaration>
Remarks

The following inherited properties are not valid for an enum, and their setter throws a NotSupportedException: IsStatic, IsSealed, IsAbstract and IsPartial. An enum is implicitly sealed, it may not be abstract or static, and the language has no partial enum.

An enum builder is not an INamedType, so it may not be used where an IType is expected. The introduced enum is read from Declaration.

Properties

Name Description
IsFlags

Gets or sets a value indicating whether the enum is annotated with FlagsAttribute.

Members

Gets the members that have been added so far, in the order in which they were added.

UnderlyingType

Gets or sets the underlying integral type of the enum. The default value is Int32.

Methods

Name Description
AddMember(string)

Adds a member whose value the language assigns, which is zero for the first member and the value of the preceding member plus one for any other.

AddMember(string, TypedConstant)

Adds a member whose value is given as a TypedConstant, which is the form in which the value of a member of another enum is read.

AddMember(string, byte)

Adds a member of the given value.

AddMember(string, short)

Adds a member of the given value.

AddMember(string, int)

Adds a member of the given value.

AddMember(string, long)

Adds a member of the given value.

AddMember(string, sbyte)

Adds a member of the given value.

AddMember(string, ushort)

Adds a member of the given value.

AddMember(string, uint)

Adds a member of the given value.

AddMember(string, ulong)

Adds a member of the given value.

Extension Methods

See Also