Building State Machines In .Net