using System; using System.Collections.Generic; using System.Text; using Domain; namespace StateMachineWorkflowActivity { public class WFContextWrapper : IWFStateTransition { private CarWFContext m_CarWFContext = null; public WFContextWrapper(CarWF owner) { m_CarWFContext = new CarWFContext(owner); SynchronizeState(owner); } private void SynchronizeState(CarWF owner) { Utilities.CarState state = owner.CarEntity.State; switch (state) { case Utilities.CarState.Start: m_CarWFContext.SetState(CarWFContext.MainMap.Start); break; case Utilities.CarState.Run: m_CarWFContext.SetState(CarWFContext.MainMap.Run); break; case Utilities.CarState.SlowDown: m_CarWFContext.SetState(CarWFContext.MainMap.SlowDown); break; case Utilities.CarState.Stop: m_CarWFContext.SetState(CarWFContext.MainMap.Stop); break; } } #region IWFStateTransition Members void IWFStateTransition.SubmitRun() { m_CarWFContext.SubmitRun(); } void IWFStateTransition.SubmitSlowDown() { m_CarWFContext.SubmitSlowDown(); } void IWFStateTransition.SubmitStop() { m_CarWFContext.SubmitStop(); } #endregion } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)