xxxxxxxxxx
public class LogCategory
{
private LogCategory(string value) { Value = value; }
public string Value { get; set; }
public static LogCategory Trace { get { return new LogCategory("Trace"); } }
public static LogCategory Debug { get { return new LogCategory("Debug"); } }
public static LogCategory Info { get { return new LogCategory("Info"); } }
public static LogCategory Warning { get { return new LogCategory("Warning"); } }
public static LogCategory Error { get { return new LogCategory("Error"); } }
}
xxxxxxxxxx
public static class Status
{
public const string Awesome = "Awesome";
public const string Cool = "Cool";
}
//Not an enum but has a similar effect without needing to convert ints
xxxxxxxxxx
// Define an enum
enum Color
{
Red,
Green,
Blue
}
// Get all the string values of the enum
string[] enumValues = Enum.GetNames(typeof(Color));
// Print the enum values
foreach (string value in enumValues)
{
Console.WriteLine(value);
}