private void ApplyQueryState(string recentQueryHashCode) { var state = string.IsNullOrEmpty(recentQueryHashCode) ? PerDatabaseState.QueryHistoryManager.GetMostRecentStateForIndex(IndexName) : PerDatabaseState.QueryHistoryManager.GetStateByHashCode(recentQueryHashCode); if (state == null) { return; } Query = state.Query; IsSpatialQuery = state.IsSpatialQuery; Latitude = state.Latitude; Longitude = state.Longitude; Radius = state.Radius; SortBy.Clear(); foreach (var sortOption in state.SortOptions) { if (SortByOptions.Contains(sortOption)) { SortBy.Add(new StringRef() { Value = sortOption }); } } Requery(); }
private void UpdateFromState(QueryState state) { Query = state.Query; IsSpatialQuery = state.IsSpatialQuery; SpatialQuery.UpdateFromState(state); UseTransformer = state.UseTransformer; DefaultOperator = state.DefaultOperator; SelectedTransformer.Value = state.Transformer; SkipTransformResults = state.SkipTransform; ShowFields = state.ShowFields; ShowEntries = state.ShowEntries; SortBy.Clear(); foreach (var sortOption in state.SortOptions) { if (SortByOptions.Contains(sortOption)) { SortBy.Add(new StringRef() { Value = sortOption }); } } }