E-mail
“..enums a great way to declare a variable of a type that can be one of a fixed set of values.”
http://geekswithblogs.net/BlackRabbitCoder/archive/2010/07/08/c-fundamentals-the-joys-and-pitfalls-of-enums.aspx
public enum ProductionStudio { MGM, Paramount, Universal, Pixar, Disney, Dreamworks};public class ProductionStudio{ public static readonly ProductionStudio MGM = new ProductionStudio(); public static readonly ProductionStudio Paramount = new ProductionStudio(); public static readonly ProductionStudio Universal = new ProductionStudio(); public static readonly ProductionStudio Pixar = new ProductionStudio(); public static readonly ProductionStudio Disney = new ProductionStudio(); public static readonly ProductionStudio Dreamworks = new ProductionStudio();}
In some situations you may want to use public static readonly… a constant really. Gives intellisense.
Remember Me
a@href@title, strike