Esempio n. 1
0
        /// <summary>
        /// Initializes the card reader
        /// </summary>
        public void InitAsync(bool simulatePackDispenser)
        {
            if (!isInitialized)
            {
                isInitialized = true;
                simulateDevice = simulatePackDispenser;

                using (FileStream stream = new FileStream(@"Technik.log", FileMode.Append, FileAccess.Write))
                {
                    StreamWriter writer = new StreamWriter(stream);
                    writer.WriteLine(string.Format(@"Datetime {0} -- InitAsync called with simulatedmode flag set to {1}.", DateTime.Now, simulateDevice));
                    writer.Flush();
                    writer.Close();
                }
                if (!simulateDevice)
                {
                    // Initialize delegate methods only once in application life cycle.
                    initMethod = new DInit(this.Init);

                    this.statusCode = (int)DispenserStatus.Initializing;
                    // Initialize the cash acceptor.
                    initMethod.BeginInvoke(false, null, null);
                }
            }
        }
Esempio n. 2
0
        public void InitAsync(bool simulateDecoder)
        {
            if (!isInitialized)
            {
                isInitialized = true;
                simulateDevice = simulateDecoder;
                // Initialize delegate methods only once in application life cycle.
                initMethod = new DInit(this.Init);

                this.statusCode = (int)DecoderStatus.Initializing;
                // Initialize the cash acceptor.
                initMethod.BeginInvoke(false, null, null);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Initializes the card reader
        /// </summary>
        public void InitAsync(bool simulateCardReader)
        {
            if (!isInitialized)
            {

                simulateDevice = simulateCardReader;

                using (FileStream stream = new FileStream(@"Xenteo.log", FileMode.Append, FileAccess.Write))
                {
                    StreamWriter writer = new StreamWriter(stream);
                    writer.WriteLine(string.Format(@"Datetime {0} -- InitAsync invoked with simulateCardReader = {1}.", DateTime.Now, simulateCardReader));
                    writer.Flush();
                    writer.Close();
                }

                // Initialize delegate methods only once in application life cycle.
                initMethod = new DInit(this.Init);

                this.statusCode = (int)ReaderStatus.Initializing;
                // Initialize the cash acceptor.
                initMethod.BeginInvoke(false, null, null);
            }
        }