private void createPlayer(int gID)
 {
     foreach (Entrant e in portal.GetEntrants(gID))
     {
         ImportPlayer ip = new ImportPlayer();
         ip.ID     = e.id.ToString();
         ip.Name   = e.name;
         ip.SKLink = getMatch(e.name);
         if (!challongePlayerList.Any(c => c.Name == e.name))
         {
             challongePlayerList.Add(ip);
         }
     }
     importPlayerBindingSource.DataSource = new BindingList <ImportPlayer>(challongePlayerList);
 }
예제 #2
0
        // Update the list of players found in the selected event.
        private void updatePlayerList()
        {
            List <String> selectedEventIDs = new List <String>();

            foreach (XElement tioEvent in xEle.Element("EventList").Element("Event").Element("Games").Elements("Game"))
            {
                if (tioEvent.Element("Name").Value == eventSelector.Text)
                {
                    foreach (XElement entrant in tioEvent.Element("Entrants").Elements("Entrant"))
                    {
                        selectedEventIDs.Add(entrant.Element("PlayerID").Value);
                    }
                    foreach (XElement entrant in tioEvent.Element("Entrants").Elements("PlayerID"))
                    {
                        selectedEventIDs.Add(entrant.Value);
                    }
                }
            }

            tioList.Clear();
            foreach (XElement player in xEle.Element("PlayerList").Element("Players").Elements("Player"))
            {
                ImportPlayer p = new ImportPlayer();
                p.ID     = player.Element("ID").Value;
                p.Name   = player.Element("Nickname").Value;
                p.SKLink = getMatch(p.Name);

                foreach (String s in selectedEventIDs)
                {
                    if (s == p.ID)
                    {
                        tioList.Add(p);
                        break;
                    }
                }
            }

            importPlayerBindingSource.DataSource = new BindingList <ImportPlayer>(tioList);
        }
예제 #3
0
        // Update the list of players found in the selected event.
        private void updatePlayerList()
        {
            if (curTourney.CompletedAt != null)
            {
                eventDatePicker.Value = curTourney.CompletedAt.Value;
            }
            else
            {
                eventDatePicker.Value = curTourney.CreatedAt.Value;
            }

            challongePlayerList.Clear();
            foreach (Participant p in portal.GetParticipants(curTourney.Id))
            {
                ImportPlayer ip = new ImportPlayer();
                ip.ID     = p.Id.ToString();
                ip.Name   = p.NameOrUsername;
                ip.SKLink = getMatch(p.NameOrUsername);

                challongePlayerList.Add(ip);
            }

            importPlayerBindingSource.DataSource = new BindingList <ImportPlayer>(challongePlayerList);
        }
        // Update the list of players found in the selected event.
        private void updatePlayerList()
        {
            if (curTourney.CompletedAt != null)
                eventDatePicker.Value = curTourney.CompletedAt.Value;
            else
                eventDatePicker.Value = curTourney.CreatedAt.Value;

            challongePlayerList.Clear();
            foreach (Participant p in portal.GetParticipants(curTourney.Id))
            {
                ImportPlayer ip = new ImportPlayer();
                ip.ID = p.Id.ToString();
                ip.Name = p.NameOrUsername;
                ip.SKLink = getMatch(p.NameOrUsername);

                challongePlayerList.Add(ip);
            }

            importPlayerBindingSource.DataSource = new BindingList<ImportPlayer>(challongePlayerList);
        }
예제 #5
0
        // Update the list of players found in the selected event.
        private void updatePlayerList()
        {
            List<String> selectedEventIDs = new List<String>();
            foreach (XElement tioEvent in xEle.Element("EventList").Element("Event").Element("Games").Elements("Game"))
            {
                if (tioEvent.Element("Name").Value == eventSelector.Text)
                {
                    foreach (XElement entrant in tioEvent.Element("Entrants").Elements("Entrant"))
                    {
                        selectedEventIDs.Add(entrant.Element("PlayerID").Value);
                    }
                    foreach (XElement entrant in tioEvent.Element("Entrants").Elements("PlayerID"))
                    {
                        selectedEventIDs.Add(entrant.Value);
                    }
                }
            }

            tioList.Clear();
            foreach (XElement player in xEle.Element("PlayerList").Element("Players").Elements("Player"))
            {
                ImportPlayer p = new ImportPlayer();
                p.ID = player.Element("ID").Value;
                p.Name = player.Element("Nickname").Value;
                p.SKLink = getMatch(p.Name);

                foreach (String s in selectedEventIDs)
                {
                    if (s == p.ID)
                    {
                        tioList.Add(p);
                        break;
                    }
                }
            }

            importPlayerBindingSource.DataSource = new BindingList<ImportPlayer>(tioList);
        }