/// <summary>
        /// The insert card.
        /// </summary>
        /// <param name="validCard">
        /// The valid card.
        /// </param>
        /// <returns>
        /// The AtmMachine
        /// </returns>
        public AtmMachine InsertCard(bool validCard)
        {
            if (this.AtmWorkflowHost == null)
            {
                throw new InvalidOperationException("The ATM StateMachine is null, the workflow may have completed or aborted");
            }

            var readerResult = new CardReaderResult {
                CardStatus = validCard ? CardStatus.Valid : CardStatus.Invalid, Event = CardReaderEvent.CardInserted
            };

            this.atmViewModel.Notify(readerResult);

            this.workflowBusy.Reset();

            var result = this.AtmWorkflowHost.ResumeBookmark(CardReaderEvent.CardInserted.ToString(), readerResult);

            switch (result)
            {
            case BookmarkResumptionResult.NotFound:
                throw new InvalidOperationException(SR.The_StateMachine_is_not_waiting_for_the_card_reader_CardInserted_event_right_now_);

            case BookmarkResumptionResult.NotReady:
                throw new InvalidOperationException(SR.The_StateMachine_is_not_ready_for_the_card_reader_CardInserted_event_right_now_);
            }

            return(this);
        }
 /// <summary>
 /// The notify.
 /// </summary>
 /// <param name="readerResult">
 /// The reader result.
 /// </param>
 public void Notify(CardReaderResult readerResult)
 {
     this.CardReaderResults.Add(readerResult);
 }
 /// <summary>
 /// The notify.
 /// </summary>
 /// <param name="readerResult">
 /// The reader result.
 /// </param>
 public void Notify(CardReaderResult readerResult)
 {
     this.Write(TraceLevel.Info, "Card Reader reports {0} with CardStatus {1}", readerResult.Event, readerResult.CardStatus);
 }