예제 #1
0
        public void Bind(IFellow fellow)
        {
            if (IsBound)
            {
                FloomeenException.Raise(_machineName, "AlreadyBound");
            }

            BoundFellow = new Fellow(fellow, _machineName);

            if (!BoundFellow.IsSet())
            {
                FloomeenException.Raise(_machineName, "CannotBindFellowBecauseNotSet.TryPlugging");
            }

            BoundFellow.CheckMachineType();

            Flow.StatesContains(BoundFellow.State);
        }
예제 #2
0
        public void Plug(IFellow fellow)
        {
            if (IsBound)
            {
                FloomeenException.Raise(_machineName, "AlreadyBound");
            }

            BoundFellow = new Fellow(fellow, _machineName);

            if (BoundFellow.IsSet())
            {
                FloomeenException.Raise(_machineName, "CannotPlugFellowBecauseAlreadySet.TryBinding");
            }

            var startState = Flow.StartState();

            BoundFellow.Plug(_machineName, startState);

            EnterNewState(startState, CreateContext());
        }