Exemplo n.º 1
0
        private static IMotorizedCardReader InitializeMotorizedCardReader(MotorizedCardReaderModel motorizedCardReader)
        {
            switch (motorizedCardReader.Type)
            {
            case MotorizedCardReaderEnum.MT318V4:
                _instance = new MotorizedCardReaderMT318V4();
                _instance.CommOpen(motorizedCardReader);
                break;

            default:
                throw new Exception("Device not implemented yet!");
            }

            return(_instance);
        }
Exemplo n.º 2
0
        public static IMotorizedCardReader Instance(MotorizedCardReaderModel motorizedCardReader = null)
        {
            if (_instance == null)
            {
                lock (_mutex)
                {
                    if (motorizedCardReader != null)
                    {
                        _instance = InitializeMotorizedCardReader(motorizedCardReader);
                    }
                    else
                    {
                        throw new Exception("Please, enter a MotorizedCardReader!");
                    }
                }
            }

            return(_instance);
        }