Esempio n. 1
0
        public EmployeeMasterCard()
        {
            _exchangeClient = new ExchangeClient();
            _exchangeClient.EMP_DATA_ACK += new _IExchangeClientEvents_EMP_DATA_ACKEventHandler(_exchangeClient_EMP_DATA_ACK);
            _exchangeClient.InitialiseExchange(0);

            if (_requestCollection == null)
            {
                _requestCollection = new SortedDictionary <int, EmployeeMasterCardThreadData>();
            }

            if (_emppollingCollection == null)
            {
                _emppollingCollection = new List <Employeecarddata>();
            }


            _thRequest = new Thread(new ThreadStart(ProcessRequest));
            _thRequest.Start();


            _thAckResponse = new ThreadDispatcher <EmployeeMasterCardThreadDataResponse>(1, "_thAckResponse_EmployeeMasterCard");
            _thAckResponse.AddProcessThreadData(new ProcessThreadDataHandler <EmployeeMasterCardThreadDataResponse>(this.ProcessResponse));
            _thAckResponse.Initialize();

            _iExchangeAdmin = (IExchangeAdmin)_exchangeClient;
            ObjectStateNotifier.AddObserver(this);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ThreadDispatcher"/> class.
 /// </summary>
 /// <param name="threadCount">The thread count.</param>
 public ThreadDispatcher(int threadCount, string helperName)
 {
     ObjectStateNotifier.AddObserver(this);
     _threadCount      = (threadCount < 0 ? 1 : threadCount);
     _threadContainers = new SortedDictionary <int, ThreadContainer>();
     _threadIndexes    = new SortedDictionary <string, int>(StringComparer.InvariantCultureIgnoreCase);
     _rnd           = new Random(_threadCount - 1);
     _evtInitialize = new ManualResetEvent(false);
     _closeHandles  = new WaitHandle[0];
     _helperName    = helperName;
     this.InitSettings();
     LogManager.WriteLog("|=> ThreadDispatcher created.", LogManager.enumLogLevel.Info);
 }
        public RleaseGameCap()
        {
            _exchangeClient              = new ExchangeClient();
            _exchangeClient.MACEnDisAck += new _IExchangeClientEvents_MACEnDisAckEventHandler(_exchangeClient_MacEnable_DATA_ACK);
            _exchangeClient.InitialiseExchange(0);

            if (_requestCollection == null)
            {
                _requestCollection = new SortedDictionary <int, EnableMachineThreadData>();
            }

            if (m_SectorData == null)
            {
                m_SectorData = new Sector203Data();
            }

            if (oGameCappingBiz == null)
            {
                oGameCappingBiz = new GameCappingBiz();
            }

            if (_lstGameCapDetails == null)
            {
                _lstGameCapDetails = new List <GameCapDetails>();
            }

            _thRequest = new Thread(new ThreadStart(ProcessRequest));

            _thAckResponse = new ThreadDispatcher <EnableMachineThreadDataResponse>(1, "_thAckResponse_EnableMachine");
            _thAckResponse.AddProcessThreadData(new ProcessThreadDataHandler <EnableMachineThreadDataResponse>(this.ProcessResponse));
            _thAckResponse.Initialize();

            _iExchangeAdmin = (IExchangeAdmin)_exchangeClient;
            ObjectStateNotifier.AddObserver(this);

            _thRequest.Start();
        }