Exemple #1
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
                    });
                }
            }
        }
Exemple #2
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();
        }
Exemple #3
0
 public void LoadBookmarks()
 {
     SortBy.Clear();
     foreach (var n in Archives.Namespaces)
     {
         SortBy.Add(n);
     }
     SortByIndex = SortBy.IndexOf(Settings.SortByDefault);
     OrderBy     = Settings.OrderByDefault;
     if (Settings.OpenBookmarksStart && Archives.Archives.Count > 0)
     {
         foreach (var b in Settings.Profile.Bookmarks)
         {
             var archive = Archives.GetArchive(b.archiveID);
             if (archive != null)
             {
                 Archives.OpenTab(archive, false);
             }
             else
             {
                 WeakReferenceMessenger.Default.Send(new ShowNotification("Bookmarked Archive with ID[" + b.archiveID + "] not found.", ""));
             }
         }
     }
     Settings.Profile.MarkedAsNonDuplicated.RemoveAll(hit => !(Archives.HasArchive(hit.Left) && Archives.HasArchive(hit.Right)));
 }