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

                ProcessResultQueue();
            }
        }
Ejemplo n.º 2
0
        private void OnImageGraphicsArrived(object sender, ImageGraphicsArrivedEventArgs args)
        {
            // If the current result info has the same result ID as the one we've just
            // received, store the image graphics in it, otherwise create a new result info object.
            lock (_currentResultInfoSyncLock)
            {
                if (_currentResultInfo.ResultId == args.ResultId)
                {
                    _currentResultInfo.ImageGraphics = args.ImageGraphics;
                }
                else
                {
                    _currentResultInfo = new ResultInfo(args.ResultId, null, args.ImageGraphics, null);
                }
            }

            _syncContext.Post(
                delegate
            {
                AddListItem("Image graphics arrived (rid=" + args.ResultId.ToString() + ")");
                ShowResult();
            },
                null);
        }