Exemplo n.º 1
0
    public SmartCardTransaction(ABC4TrustSmartCard device, SCardReaderDisposition disMethod = SCardReaderDisposition.Leave)
    {
      this.device = device;
      this.disMethod = disMethod;
      int noRetry = 10;
      int i = 0;
      if (device.doProfile)
      {
        profileLogger = Logger.Instance.getLog(device.pInfo.loggerToUse);
        timer = new AbcTimer();
        timer.Start();
      }

      while (TryTransaction() != 0)
      {
        if (i < noRetry)
        {
          System.Threading.Thread.Sleep(1000);
        }
        else
        {
          // TODO find a better exception.
          throw new Exception("Could not get exclusive lock on card");
        }
        ++i;
      } 
    }
Exemplo n.º 2
0
        public SmartCardTransaction(ABC4TrustSmartCard device, SCardReaderDisposition disMethod = SCardReaderDisposition.Leave)
        {
            this.device    = device;
            this.disMethod = disMethod;
            int noRetry = 10;
            int i       = 0;

            if (device.doProfile)
            {
                profileLogger = Logger.Instance.getLog(device.pInfo.loggerToUse);
                timer         = new AbcTimer();
                timer.Start();
            }

            while (TryTransaction() != 0)
            {
                if (i < noRetry)
                {
                    System.Threading.Thread.Sleep(1000);
                }
                else
                {
                    // TODO find a better exception.
                    throw new Exception("Could not get exclusive lock on card");
                }
                ++i;
            }
        }