private void OnReadStringArrived(object sender, ReadStringArrivedEventArgs args)
        {
            // If the current result info has the same result ID as the one we've just
            // received, store the read string in it, otherwise create a new result info object.
            lock (_currentResultInfoSyncLock)
            {
                if (_resultCache.ContainsKey(args.ResultId))
                {
                    _resultCache[args.ResultId].ReadString = args.ReadString;
                }
                else
                {
                    _resultCache.Add(args.ResultId, new ResultInfo(args.ResultId, null, null, args.ReadString, null));
                }

                ProcessResultQueue();
            }
        }
示例#2
0
        private void OnReadStringArrived(object sender, ReadStringArrivedEventArgs args)
        {
            // If the current result info has the same result ID as the one we've just
            // received, store the read string in it, otherwise create a new result info object.
            lock (_currentResultInfoSyncLock)
            {
                if (_currentResultInfo.ResultId == args.ResultId)
                {
                    _currentResultInfo.ReadString = args.ReadString;
                }
                else
                {
                    _currentResultInfo = new ResultInfo(args.ResultId, null, null, args.ReadString);
                }
            }

            _syncContext.Post(
                delegate
            {
                AddListItem("Read string arrived : resultId = " + args.ResultId + ", read string = " + args.ReadString);
                ShowResult();
            },
                null);
        }
示例#3
0
 private void DataManSystem_ReadStringArrived(object sender, ReadStringArrivedEventArgs args)
 {
     this.Invoke(GetData, args.ReadString);
 }