Ejemplo n.º 1
0
        private async void btnConfirmTeam_Click(object sender, EventArgs e)
        {
            selectedCountry = countriesList[listTeams.SelectedIndex] as Country;

            if (playersList.Count != 0)
            {
                flpPlayers.Controls.Clear();
            }

            playersList = await Data.GetPlayersForCountry($"https://worldcup.sfg.io/matches/country?fifa_code={selectedCountry.FifaCode}", selectedCountry.FifaCode);

            foreach (var player in playersList)
            {
                PlayerProfile playerCard = CreateNewPlayerCard(player);
                playerCard.MouseDown += PlayerCard_MouseDown;
                flpPlayers.Controls.Add(playerCard);
            }
            flpFavoritePlayers.AllowDrop = true;
            btnAttendence.Enabled        = true;
            btnPlayerRanking.Enabled     = true;


            // FileRepo.SaveFavoriteTeam(favTeamFolder,favTeamFile,selectedCountry);
            FileRepo.WriteToFile(new[] { listTeams.Text }, FileRepo.FAV_COUNTRY);
        }
Ejemplo n.º 2
0
        protected override void OnClosing(CancelEventArgs e)
        {
            base.OnClosing(e);
            string       msg    = Resources.Zatvaranje;
            DialogResult result = MessageBox.Show(msg, Resources.ZatvaranjeNaslov,
                                                  MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (result == DialogResult.Yes)
            {
                FileRepo.WriteToFile(new[] { listTeams.Text }, FileRepo.FAV_COUNTRY);
            }
            else if (result == DialogResult.No)
            {
                e.Cancel = true;
            }
        }
Ejemplo n.º 3
0
 private void button1_Click(object sender, EventArgs e)
 {
     FileRepo.WriteToFile(new[] { flpFavoritePlayers.ToString() }, FileRepo.FAVPLAYERS_PATH);
 }