public void SwitchMe(StatesEnum state) { switch (state) { case StatesEnum.Stopped: Start(); goto case StatesEnum.Starting; case StatesEnum.Started: Stop(); goto case StatesEnum.Stopping; case StatesEnum.Stopping: state = StatesEnum.Stopping; goto default; case StatesEnum.Starting: state = StatesEnum.Starting; goto default; default: Log(state); break; }}public enum StatesEnum { Stopped, Starting, Started, Stopping}
So, looking above, if state = Stopped and was passed to the SwitchMe method, the code would execute as follows:
I'm Dusty Candland a software developer in Colorado.
Email