Exemple #1
0
        private void SetupTamedSearches()
        {
            var wildcard    = new string[] { null };
            var speciesList = wildcard.Concat(arkReaderTamed.AllSpecies).ToList();
            var orderList   = Enumerable.Range(0, speciesList.Count);
            var searches    = speciesList.Zip(orderList, (species, order) => new SearchCriteria {
                Species = species, Order = order
            });

            ListSearches.Clear();
            foreach (var search in searches)
            {
                ListSearches.Add(search);
            }
        }
Exemple #2
0
        private void LoadSavedSearches()
        {
            if (!String.IsNullOrWhiteSpace(Properties.Settings.Default.SavedSearches))
            {
                Collection <SearchCriteria> searches;
                try
                {
                    searches = JsonConvert.DeserializeObject <Collection <SearchCriteria> >(Properties.Settings.Default.SavedSearches);
                }
                catch (Exception e)
                {
                    Console.WriteLine("Exception reading saved searches: " + e.ToString());
                    return;
                }

                ListSearches.Clear();
                foreach (var search in searches)
                {
                    ListSearches.Add(search);
                }
            }
        }