public enum AEnum { One, Two, Three }
public void DoStuff(AEnum e) { switch (e) { case AEnum.One: Console.WriteLine("AEnum.One"); break; case AEnum.Two: Console.WriteLine("AEnum.Two"); break; case AEnum.Three: Console.WriteLine("AEnum.Three"); break; default: throw new Exception("Unhandled enumeration value"); break; } }
public void DoStuff(Enum e) { AEnum ae = (AEnum)e; switch (ae) { case AEnum.One: Console.WriteLine("AEnum.One"); break; case AEnum.Two: Console.WriteLine("AEnum.Two"); break; case AEnum.Three: Console.WriteLine("AEnum.Three"); break; default: throw new Exception("Unhandled enumeration value"); break; } }
Powered by: newtelligence dasBlog 2.1.8102.813
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2010, Shawn Neal
E-mail