Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does None=1 refer in the following enum class?

Tags:

People also ask

Do C# enums start at 0 or 1?

The first member of an enum will be 0, and the value of each successive enum member is increased by 1. You can assign different values to enum member.

What are enum types?

Enumerated (enum) types are data types that comprise a static, ordered set of values. They are equivalent to the enum types supported in a number of programming languages. An example of an enum type might be the days of the week, or a set of status values for a piece of data.

What is default enum value?

The default value of an enumeration type E is the value produced by expression (E)0 , even if zero doesn't have the corresponding enum member.

What is the value of an enum?

The default value of an enum E is the value produced by the expression (E)0 . Without overriding the default values, printing default(E) returns Foo since it's the first-occurring element.


I have noticed the following enum declaration while browsing some sample code. What does None=1 mean ?

public enum ButtonActions
{
    None = 1,        
    Clear,
    Insert,       
    Delete,
    Cancel,
    Close
}