コード例 #1
0
        /// <summary>
        /// Gets a description of the tournament suitable for metadata or search results
        /// </summary>
        public string Description()
        {
            var description = new StringBuilder();

            description.Append("Stoolball tournament");
            if (TournamentLocation != null)
            {
                description.Append(" at ").Append(TournamentLocation.NameAndLocalityOrTown());
            }

            var seasonList = string.Empty;

            if (Seasons.Count == 1)
            {
                var season = Seasons.First();
                var the    = season.Competition.CompetitionName.ToUpperInvariant().Contains("THE ");
                description.Append(" in ").Append(the ? string.Empty : "the ").Append(season.Competition.CompetitionName);
            }
            else if (Seasons.Count > 1)
            {
                description.Append(" in ");
                description.Append(Seasons.Humanize(x => x.Competition.CompetitionName));
            }

            description.Append(seasonList);

            description.Append('.');

            return(description.ToString());
        }
コード例 #2
0
        /// <summary>
        ///     Выбрать первый сезон в списке (решается баг с потерей фокуса курсора)
        /// </summary>

        public void SelectSeason()
        {
            if (CanSelectSeason is false)
            {
                return;
            }

            SelectedSeason = Seasons.First();
        }
コード例 #3
0
        public PlayerViewModel(Player player)
        {
            Player = player;
            int yearNow = DateTime.Now.Year;

            if (DateTime.Now.Month <= 9)
            {
                yearNow -= 1;
            }

            Seasons = Enumerable.Range(1979, yearNow - 1978).OrderByDescending(x => x).Select(x => new Season()
            {
                Year = x
            }).ToList();

            SelectedSeason = Seasons.First();
        }
コード例 #4
0
        public async Task GetPickerValues()
        {
            var countriesList = await CountryDataStore.GetItemsAsync();

            foreach (Country c in countriesList)
            {
                Countries.Add(c);
            }

            SelectedCountry = Countries.First(x => x.Id == Model.Country.Id);


            var citiesList = await CityDataStore.GetItemsAsync();

            foreach (var item in citiesList)
            {
                Cities.Add(item);
            }

            SelectedCity = Cities.First(x => x.Id == Model.City.Id);


            var seasonsList = await SeasonDataStore.GetItemsAsync();

            foreach (var item in seasonsList)
            {
                Seasons.Add(item);
            }

            SelectedSeason = Seasons.First(x => x.Id == Model.Season.Id);


            var currenciesList = await CurrencyDataStore.GetItemsAsync();

            foreach (var item in currenciesList)
            {
                Currencies.Add(item);
            }

            SelectedCurrency = Currencies.First(x => x.Id == Model.Currency.Id);

            IsBusy = false;
        }
コード例 #5
0
 /// <summary>
 /// Переустановить выбранный сезон
 /// </summary>
 /// <param name="season">Новое значение сезона</param>
 public void ResetSelectedSeason(Season season)
 {
     SetSeasons(SelectedFilm);
     SelectedSeason = Seasons.First(s => s.Number == season.Number);
 }