void OnSearchFinished(SearchResultSingleSummary singleSummary)
        {
            if (singleSummary == null)
            {
                return;
            }
            if (m_searchSessionID != singleSummary.SearchSessionID)
            {
                return;
            }

            if (m_currSearchItem.TaskUnitId != singleSummary.TaskUnitID)
            {
                return;
            }

            MyLog4Net.Container.Instance.Log.InfoFormat("SearchResultSingleViewModel ({0}) OnSearchFinished, taskUnitName: {1}, singleSummary taskUnitID: {2}, m_currSearchItem.TaskUnitId: {3}, total count: {4}",
                                                        this.GetHashCode(), Title, singleSummary.TaskUnitID,
                                                        m_currSearchItem.TaskUnitId, singleSummary.TotalCount);

            if (this.m_PageInfo == null || IsSearching)
            {
                HandleSearchFinishedEvent(singleSummary);
                MyLog4Net.Container.Instance.Log.InfoFormat("Called HandleSearchFinishedEvent from single view model: item {0}", this.m_currSearchItem.TaskUnitId);
            }
            else
            {
                // Debug.Assert(false, "SearchFinished has been fired in view");
            }
        }
        private void UpdatePageInfo(SearchResultSingleSummary singleSummary)
        {
            if (m_PageInfo == null)
            {
                m_PageInfo = new PageInfo(singleSummary.TotalPage, singleSummary.TotalCount, singleSummary.CurrPageIndex);
                m_PageInfo.CurrentPageCount           = singleSummary.CurrPageTotalCount;
                m_PageInfo.SelectedPageNumberChanged += new EventHandler(ResultPageInfo_SelectedPageNumberChanged);
            }
            else
            {
                m_PageInfo.TotalRecords     = singleSummary.TotalCount;
                m_PageInfo.CurrentPageCount = singleSummary.CurrPageTotalCount;
                m_PageInfo.Count            = singleSummary.TotalPage;
                m_PageInfo.Index            = singleSummary.CurrPageIndex;
            }

            if (m_DetailViewPageInfo == null)
            {
                m_DetailViewPageInfo = new PageInfo(singleSummary.CurrPageTotalCount, singleSummary.CurrPageTotalCount, 0);
            }
            else
            {
                m_DetailViewPageInfo.TotalRecords = singleSummary.CurrPageTotalCount;
                m_DetailViewPageInfo.Count        = singleSummary.CurrPageTotalCount;
                m_DetailViewPageInfo.Index        = 0;
            }
        }
Exemple #3
0
        void IVXProtocol_SearchItemResultReceived(SearchItemResult obj)
        {
            lock (m_SyncObjSearch)
            {
                SearchSession searchSession = GetSearchSession((int)obj.SearchId);
                if (searchSession == null)
                {
                    return;
                }

                //if (searchSession.SearchPara.DisplayMode != SearchResultDisplayMode.ThumbNailAllSearchItem)
                //{
                //    if (obj.TaskUnitId != searchSession.SearchPara.CurrentSearchItem.TaskUnitId)
                //    {
                //        return;
                //    }
                //}

                SearchResultSingleSummary result = new SearchResultSingleSummary();
                result.IsSimilaritySearch = searchSession.SearchPara.IsSimilaritySearch;
                result.CurrPageIndex      = obj.PageInfo.Index;
                result.CurrPageTotalCount = obj.PageInfo.CountInCurrentPage;
                result.SearchResultList   = obj.ResultRecords;

                if (searchSession.SearchPara.SearchType == SearchType.Vehicle)
                {
                    UpdateSearchResultRecords(result.SearchResultList);
                }

                result.SearchSessionID = obj.SearchId;
                result.TaskUnitID      = obj.TaskUnitId;
                result.TotalCount      = obj.PageInfo.TotalCount;
                result.TotalPage       = obj.PageInfo.TotalPage;

                SearchItem searchItem = searchSession.SearchPara.GetSeachItem(obj.TaskUnitId);
                lock (searchItem)
                {
                    searchItem.IsFinished    = true;
                    searchItem.ResultSummary = result;
                    MyLog4Net.Container.Instance.Log.InfoFormat("Fire SearchFinishedEvent in VideoSearchService, taskUnitID: {0}", result.TaskUnitID);
                    Framework.Container.Instance.EvtAggregator.GetEvent <SearchFinishedEvent>().Publish(result);
                }
            }
        }
        internal void HandleSearchFinishedEvent(SearchResultSingleSummary singleSummary)
        {
            m_ResultSummary = singleSummary;
            BuildSearchResultRecordTable();

            UpdatePageInfo(singleSummary);

            IsSearching = false;

            if (singleSummary.SearchResultList != null && singleSummary.SearchResultList.Count > 0)
            {
                StatusText = string.Empty;
            }
            else
            {
                StatusText = "无匹配的结果";
            }

            if (SearchFinished != null)
            {
                SearchFinished(this, singleSummary);
            }
        }
Exemple #5
0
        //private void ShowCirularProgress(bool show)
        //{
        //    //ShowCirularProgress(circularProgress1, picEditOriginal, show);
        //    //ShowCirularProgress(circularProgress2, picEditThumb, show);
        //}

        //private void UpdateCircularPosition(CircularProgress circular)
        //{
        //    //int x = circular.Parent.Width / 2;
        //    //int y = circular.Parent.Height / 2;
        //    //circular.Location = new System.Drawing.Point(x - circular.Width / 2, y - circular.Height / 2);
        //}

        #endregion

        #region Internal helper functions

        internal void SwitchRecord(SearchResultSingleSummary summary, SearchResultRecord record)
        {
            m_resultSummary = summary;
            Record          = record;
        }