Last active
June 24, 2016 11:54
-
-
Save mvacha/542f7b7bfaf5837b0f3ae6be25d4e1d8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static State Request(this State state, Transition transition) => | |
(state, transition) match | |
( | |
case (State.Running, Transition.Suspend): State.Suspended | |
case (State.Suspended, Transition.Resume): State.Running | |
case (State.Suspended, Transition.Terminate): State.NotRunning | |
case (State.NotRunning, Transition.Activate): State.Running | |
case *: throw new InvalidOperationException() | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment