예제 #1
0
        /// <summary>
        /// Claim the magnetic stripe reader
        /// </summary>
        /// <returns>true if claim is successful. Otherwise returns false</returns>
        private async Task <bool> ClaimReader()
        {
            if (_claimedReader == null)
            {
                // claim the magnetic stripe reader
                _claimedReader = await _reader.ClaimReaderAsync();

                if (_claimedReader == null)
                {
                    rootPage.NotifyUser("Claim Magnetic Stripe Reader failed.", NotifyType.ErrorMessage);
                    return(false);
                }
            }
            return(true);
        }
        //<SnippetClaimMagStripeReader>
        // Claims the magnetic stripe reader for exclusive use.

        private async Task <bool> ClaimReader()
        {
            if (_claimedReader == null)
            {
                _claimedReader = await _reader.ClaimReaderAsync();

                if (_claimedReader != null)
                {
                    // UpdateReaderStatusTextBlock("Magnetic stripe reader claimed successfully.");
                }
                else
                {
                    // UpdateReaderStatusTextBlock("Failed to claim a magnetic stripe reader.");
                    return(false);
                }
            }
            return(true);
        }
예제 #3
0
        /// <summary>
        /// Claim the magnetic stripe reader
        /// </summary>
        /// <returns>true if claim is successful. Otherwise returns false</returns>
        private async Task <bool> ClaimReader()
        {
            if (_claimedReader == null)
            {
                // claim the magnetic stripe reader
                _claimedReader = await _reader.ClaimReaderAsync();

                // enable the claimed magnetic stripe reader
                if (_claimedReader != null)
                {
                    UpdateReaderStatusTextBlock("Claim Magnetic Stripe Reader succeeded.");
                }
                else
                {
                    UpdateReaderStatusTextBlock("Claim Magnetic Stripe Reader failed.");
                    return(false);
                }
            }
            return(true);
        }