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