# Enum

***

**1. Days of the Week**

```csharp
public enum DayOfWeek
{
    Sunday,
    Monday,
    Tuesday,
    Wednesday,
    Thursday,
    Friday,
    Saturday
}
```

**2. Months of the Year**

```csharp
public enum Month
{
    January,
    February,
    March,
    April,
    May,
    June,
    July,
    August,
    September,
    October,
    November,
    December
}
```

**3. File Extensions**

```csharp
public enum FileExtension
{
    Txt,
    Doc,
    Png,
    Jpg,
    Pdf
}
```

**4. Database Types**

```csharp
public enum DatabaseType
{
    MySql,
    SqlServer,
    Oracle,
    PostgreSQL,
    SQLite
}
```

**5. Programming Languages**

```csharp
public enum ProgrammingLanguage
{
    CSharp,
    Java,
    Python,
    JavaScript,
    SQL
}
```

**6. Card Values**

```csharp
public enum CardValue
{
    Ace,
    Two,
    Three,
    Four,
    Five,
    Six,
    Seven,
    Eight,
    Nine,
    Ten,
    Jack,
    Queen,
    King
}
```

**7. Card Suits**

```csharp
public enum CardSuit
{
    Hearts,
    Diamonds,
    Spades,
    Clubs
}
```

**8. Directions**

```csharp
public enum Direction
{
    North,
    South,
    East,
    West
}
```

**9. Sizes**

```csharp
public enum Size
{
    Small,
    Medium,
    Large,
    ExtraLarge
}
```

**10. Colors**

```csharp
public enum Color
{
    Red,
    Green,
    Blue,
    Yellow,
    Black
}
```

**11. Order Statuses**

```csharp
public enum OrderStatus
{
    Pending,
    Processing,
    Shipped,
    Delivered,
    Cancelled
}
```

**12. Gender**

```csharp
public enum Gender
{
    Male,
    Female
}
```

**13. Relationship Status**

```csharp
public enum RelationshipStatus
{
    Single,
    Married,
    Divorced,
    Widowed
}
```

**14. User Roles**

```csharp
public enum UserRole
{
    Administrator,
    Manager,
    Employee,
    Customer
}
```

**15. Transaction Types**

```csharp
public enum TransactionType
{
    Deposit,
    Withdrawal,
    Transfer
}
```

**16. File Permissions**

```csharp
public enum FilePermission
{
    Read,
    Write,
    Execute
}
```

**17. Error Codes**

```csharp
public enum ErrorCode
{
    Success,
    InvalidInput,
    NotFound,
    DatabaseError
}
```

**18. Weather Conditions**

```csharp
public enum WeatherCondition
{
    Sunny,
    Rainy,
    Cloudy,
    Snowy
}
```

**19. Musical Instruments**

```csharp
public enum MusicalInstrument
{
    Guitar,
    Piano,
    Drums,
    Violin,
    Saxophone
}
```

**20. Vehicle Types**

```csharp
public enum VehicleType
{
    Car,
    Truck,
    Motorcycle,
    Bicycle,
    Bus
}
```

**21. Sport Types**

```csharp
public enum SportType
{
    Football,
    Basketball,
    Tennis,
    Swimming,
    Running
}
```

**22. Book Genres**

```csharp
public enum BookGenre
{
    Fiction,
    NonFiction,
    Thriller,
    Romance,
    Mystery
}
```

**23. Currency Types**

```csharp
public enum CurrencyType
{
    USD,
    EUR,
    GBP,
    JPY,
    CNY
}
```

**24. Socket Types**

```csharp
public enum SocketType
{
    Tcp,
    Udp,
    Http,
    WebSocket
}
```

**25. HTTP Methods**

```csharp
public enum HttpMethod
{
    Get,
    Post,
    Put,
    Delete
}
```

**26. HTTP Status Codes**

```csharp
public enum HttpStatusCode
{
    Ok,
    BadRequest,
    NotFound,
    InternalServerError
}
```

**27. Data Types**

```csharp
public enum DataType
{
    Int,
    Double,
    String,
    Boolean,
    DateTime
}
```

**28. Logical Operators**

```csharp
public enum LogicalOperator
{
    And,
    Or,
    Not
}
```

**29. Comparison Operators**

```csharp
public enum ComparisonOperator
{
    Equal,
    NotEqual,
    LessThan,
    GreaterThan,
    LessThanOrEqual,
    GreaterThanOrEqual
}
```

**30. Bitwise Operators**

```csharp
public enum BitwiseOperator
{
    And,
    Or,
    Xor
}
```

**31. Assignment Operators**

```csharp
public enum AssignmentOperator
{
    Add,
    Subtract,
    Multiply,
    Divide,
    Modulo
}
```

**32. Increment/Decrement Operators**

```csharp
public enum IncrementDecrementOperator
{
    PreIncrement,
    PostIncrement,
    PreDecrement,
    PostDecrement
}
```

**33. Shift Operators**

```csharp
public enum ShiftOperator
{
    LeftShift,
    RightShift
}
```

**34. Conditional Operators**

```csharp
public enum ConditionalOperator
{
    If,
    IfElse,
    Switch
}
```

**35. Loop Statements**

```csharp
public enum LoopStatement
{
    For,
    ForEach,
    While,
    DoWhile
}
```

**36. Jump Statements**

```csharp
public enum JumpStatement
{
    Break,
    Continue,
    Return
}
```

**37. Exception Handling**

```csharp
public enum ExceptionHandling
{
    TryCatch,
    TryCatchFinally
}
```

**38. Delegates**

```csharp
public enum DelegateAction
{
    Method1,
    Method2,
    Method3
}
```

**39. Events**

```csharp
public enum EventAction
{
    Event1,
    Event2,
    Event3
}
```

**40. Reflection**

```csharp
public enum ReflectionType
{
    Property,
    Method,
    Field,
    Parameter
}
```

**41. Attributes**

```csharp
public enum AttributeType
{
    Browsable,
    Validation
}
```

**42. Internals**

```csharp
public enum InternalEnum
{
    Value1,
    Value2
}
```

**43. Compiler Directives**

```csharp
public enum CompilerDirective
{
    Define,
    Undefine,
    If,
    Else,
    EndIf
}
```

**44. Predefined Types**

```csharp
public enum PredefinedType
{
    Object,
    String,
    Int32,
    Double,
    Boolean
}
```

**45. Aliases**

```csharp
public enum AliasType
{
    OldName = NewName,
    LegacyName = ModernName
}
```

**46. Extension Methods**

```csharp
public static class MyExtensions
{
    public static string ToUpperInvariant(this string str)
    {
        return str.ToUpperInvariant();
    }
}

public class MyClass
{
    public void MyMethod()
    {
        string s = "hello".ToUpperInvariant();
    }
}
```

**47. Type Conversions**

```csharp
public enum MyEnum
{
    Value1,
    Value2
}

public class MyClass
{
    public void MyMethod()
    {
        MyEnum e = MyEnum.Value1;
        int i = (int)e;
    }
}
```

**48. Enum Masks**

```csharp
[Flags]
public enum MyEnum
{
    Value1 = 1,
    Value2 = 2,
    Value3 = 4
}

public class MyClass
{
    public void MyMethod()
    {
        MyEnum e = MyEnum.Value1 | MyEnum.Value2;
    }
}
```

**49. Custom Attributes**

```csharp
public class MyAttribute : Attribute
{
    public string Description { get; set; }
}

[MyAttribute(Description = "This is a custom attribute.")]
public class MyClass
{
    public void MyMethod()
    {
        // Get the attribute from the class.
        MyAttribute attribute = (MyAttribute)Attribute.GetCustomAttribute(typeof(MyClass), typeof(MyAttribute));

        // Use the attribute.
        string description = attribute.Description;
    }
}
```

**50. XML Serialization**

```csharp
[Serializable]
public enum MyEnum
{
    Value1,
    Value2
}

public class MyClass
{
    public MyEnum MyProperty { get; set; }

    public void MyMethod()
    {
        // Serialize the enum value to XML.
        string xml = XmlSerializer.Serialize(typeof(MyEnum), MyProperty);

        // Deserialize the XML back to the enum value.
        MyEnum deserializedValue = (MyEnum)XmlSerializer.Deserialize(typeof(MyEnum), xml);
    }
}
```
