public SearchPageState SaveState() { var state = new SearchPageState() { SearchResultInfo = this.SearchResultInfo }; if (null != QueryParameter) { state.QueryParameter = QueryParameter; } if (null != DocumentReferences) { state.DocumentReferencesList = DocumentReferences.ToList(); state.Hits = DocumentReferences.Hits; state.Page = DocumentReferences.Page; state.PageSize = DocumentReferences.PageSize; } return state; }
public void LoadState(SearchPageState state) { if (null != state.QueryParameter) { QueryParameter = state.QueryParameter; } if (!String.IsNullOrWhiteSpace(state.SearchResultInfo)) { SearchResultInfo = state.SearchResultInfo; } if (null != state.DocumentReferencesList) { var resultTemp = new SearchResult() { Hits = state.Hits, Page = state.Page, PageSize = state.PageSize, DocumentReferences = state.DocumentReferencesList }; DocumentReferences = new RisQueryWithIncrementalLoading( QueryParameter, resultTemp, IncrementalLoadingStarted, IncrementalLoadingCompleted, IncrementalLoadingFailed); UpdateSearchResultInfo(); } }