Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        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
                    });
                }
            }
        }