public static int GetDefaultCountPerPage(bool multiSearchItem, SearchResultDisplayMode displayMode) { int count = 25; if (displayMode == DataModel.SearchResultDisplayMode.GridViewOneSearchItem) { count = 50; } else if (displayMode == DataModel.SearchResultDisplayMode.ThumbNailAllSearchItem) { //if (multiSearchItem) //{ // count = 10; //} } return(count); }
public void Commit() { TaskUnitInfo[] taskUnits = Framework.Container.Instance.SelectedTaskUnitsForSearch; if (Validate(taskUnits)) { // ComposeSearchPara(); bool multiItem = taskUnits.Length > 1; SearchResultDisplayMode displayMode = Framework.Environment.GetDisplayMode(SearchType); m_SearchPara.PageInfo.CountPerPage = Framework.Environment.GetDefaultCountPerPage(multiItem, displayMode); SearchItem[] searchItems = GetSearchItems(taskUnits); if (searchItems != null) { m_SearchPara.CurrentSearchItemIndex = 0; m_SearchPara.SearchItems = searchItems.ToList(); } CommitEx(); } }
private void ResearchOnDisplayModeChanged() { if (m_searchSession != null && m_searchSession.SearchPara != null) { SearchResultDisplayMode displayMode = Framework.Environment.GetDisplayMode(m_SearchType); m_searchSession.SearchPara.DisplayMode = displayMode; bool multiItem = m_searchSession.SearchPara.SearchItems.Count > 1; m_searchSession.SearchPara.PageInfo.CountPerPage = Framework.Environment.GetDefaultCountPerPage(multiItem, displayMode); m_searchSession.SearchPara.SearchItems.ForEach(item => item.PageInfo.CountInCurrentPage = m_searchSession.SearchPara.PageInfo.CountPerPage); try { Framework.Container.Instance.VideoSearchService.StartSearch(m_searchSession.SearchPara); } catch (SDKCallException ex) { Common.SDKCallExceptionHandler.Handle(ex, "切换显示模式重新检索"); } } }
public static void SetDisplayMode(SearchType searchType, SearchResultDisplayMode mode) { s_DTSearchType2DisplayMode[searchType] = mode; }