/// <summary>
        /// Reset the Scenario state
        /// </summary>
        void ResetTheScenarioState()
        {
            if (_claimedReader != null)
            {
                // Detach the datareceived event handler and releasedevicerequested event handler
                _claimedReader.BankCardDataReceived   -= OnBankCardDataReceived;
                _claimedReader.ReleaseDeviceRequested -= OnReleaseDeviceRequested;

                // release the Claimed Magnetic Stripe Reader and set to null
                _claimedReader.Dispose();
                _claimedReader = null;
            }

            if (_reader != null)
            {
                // release the Magnetic Stripe Reader and set to null
                _reader = null;
            }

            // Reset the strings in the UI
            rootPage.NotifyUser("Click the Start Receiving Data Button.", NotifyType.StatusMessage);

            ScenarioOutputAccountNumber.Text  = "No data";
            ScenarioOutputExpirationDate.Text = "No data";
            ScenarioOutputFirstName.Text      = "No data";
            ScenarioOutputMiddleInitial.Text  = "No data";
            ScenarioOutputServiceCode.Text    = "No data";
            ScenarioOutputSuffix.Text         = "No data";
            ScenarioOutputSurname.Text        = "No data";
            ScenarioOutputTitle.Text          = "No data";

            // reset the button state
            ScenarioEndReadButton.IsEnabled   = false;
            ScenarioStartReadButton.IsEnabled = true;
        }
示例#2
0
        /// <summary>
        /// Reset the Scenario state
        /// </summary>
        void ResetTheScenarioState()
        {
            if (_claimedReader != null)
            {
                // Detach the datareceived event handler and releasedevicerequested event handler
                _claimedReader.AamvaCardDataReceived  -= OnAamvaCardDataReceived;
                _claimedReader.ReleaseDeviceRequested -= OnReleaseDeviceRequested;

                // release the Claimed Magnetic Stripe Reader and set to null
                _claimedReader.Dispose();
                _claimedReader = null;
            }

            if (_reader != null)
            {
                // release the Magnetic Stripe Reader and set to null
                _reader.Dispose();
                _reader = null;
            }

            // Reset the strings in the UI
            rootPage.NotifyUser("Click the Start Receiving Data Button.", NotifyType.StatusMessage);

            ScenarioOutputAddress.Text        = "No data";
            ScenarioOutputBirthDate.Text      = "No data";
            ScenarioOutputCity.Text           = "No data";
            ScenarioOutputClass.Text          = "No data";
            ScenarioOutputEndorsements.Text   = "No data";
            ScenarioOutputExpirationDate.Text = "No data";
            ScenarioOutputEyeColor.Text       = "No data";
            ScenarioOutputFirstName.Text      = "No data";
            ScenarioOutputGender.Text         = "No data";
            ScenarioOutputHairColor.Text      = "No data";
            ScenarioOutputHeight.Text         = "No data";
            ScenarioOutputLicenseNumber.Text  = "No data";
            ScenarioOutputPostalCode.Text     = "No data";
            ScenarioOutputRestrictions.Text   = "No data";
            ScenarioOutputState.Text          = "No data";
            ScenarioOutputSuffix.Text         = "No data";
            ScenarioOutputSurname.Text        = "No data";
            ScenarioOutputWeight.Text         = "No data";

            // reset the button state
            ScenarioEndReadButton.IsEnabled   = false;
            ScenarioStartReadButton.IsEnabled = true;
        }