private void RefreshSearch(bool isAppending)
 {
     if (isAppending)
     {
         foreach (MapItemVM mapItemVm in MapSearchResults.ToList())
         {
             if (mapItemVm.MapName.IndexOf(_searchText, StringComparison.OrdinalIgnoreCase) < 0)
             {
                 MapSearchResults.Remove(mapItemVm);
             }
             else
             {
                 mapItemVm.UpdateSearchedText(_searchText);
             }
         }
     }
     else
     {
         MapSearchResults.Clear();
         foreach (MapItemVM availableMap in _availableMaps)
         {
             MapItemVM map = availableMap;
             if (map.MapName.IndexOf(_searchText, StringComparison.OrdinalIgnoreCase) >= 0 && MapSearchResults.All(m => m.MapName != map.MapName))
             {
                 MapSearchResults.Add(map);
             }
         }
     }
 }
        public void OnGameTypeChange(BattleType gameType)
        {
            MapSearchResults.Clear();
            switch (gameType)
            {
            case BattleType.Field:
                IsCurrentMapSiege = false;
                _availableMaps    = _battleMaps;
                break;

            case BattleType.Siege:
                IsCurrentMapSiege = true;
                _availableMaps    = _siegeMaps;
                break;

            case BattleType.Village:
                IsCurrentMapSiege = false;
                _availableMaps    = _villageMaps;
                break;
            }
            foreach (MapItemVM availableMap in _availableMaps)
            {
                MapSearchResults.Add(availableMap);
            }
            _searchText = new TextObject("{=7i1vmgQ9}Select a Map").ToString();
            OnPropertyChanged(nameof(SearchText));
        }
예제 #3
0
        private void SwitchToStations()
        {
            isStopSearch = true;

            StationsVisibility = Visibility.Visible;
            SearchVisibility   = Visibility.Collapsed;

            SelectedStationVisibility     = Visibility.Collapsed;
            SelectedCustomPointVisibility = Visibility.Collapsed;
            SelectedSearchItemVisibility  = Visibility.Collapsed;

            if (isPointA)
            {
                PointA.Hide();
            }
            else
            {
                PointB.Hide();
            }

            MapSearchResults.Clear();

            ClearSearchTextBox();

            ShowStopsList();
        }
        public JsonResult GetMapPoints(double lat, double longitude, double radius, int maxResults = 50)
        {
            var              beginSearchTime = DateTime.Now;
            var              spatialResults  = this._searchOfficeService.GetSpatialResultsByDistance(new Location(lat, longitude), radius, maxResults);
            var              endSearchTime   = DateTime.Now;
            TimeSpan         spanDifference  = endSearchTime - beginSearchTime;
            int              msSeachTook     = (int)spanDifference.TotalMilliseconds;
            MapSearchResults results         = new MapSearchResults(spatialResults.ToList(), msSeachTook);

            return(this.Json(results));
        }
예제 #5
0
        private void TimerTickMapMoved(object sender, EventArgs e)
        {
            this.timerMapMoved.Stop();

            MapStops.Clear();
            MapSearchResults.Clear();

            if (isStopSearch)
            {
                this.MapStops.AddRange(UnitOfWork.PublicStopRepository.GetNearby(numNearbyToLoadForMap, new Coordinate(MapCenterPoint.Latitude, MapCenterPoint.Longitude)));
            }
            else
            {
                this.MapSearchResults.AddRange(SearchResults);
            }
        }