Exemplo n.º 1
0
        private void calculatePlayerStats(Sports sport)
        {
            GenerateTeams teamGen = parseFile(sport);

            if (teamGen != null)
            {
                saveFile(teamGen.convertPlayersToValues());
            }
        }
Exemplo n.º 2
0
            public void saveTeams(GenerateTeams teamGen, EventArgs e)
            {
                Thread thread = new Thread(() =>
                {
                    String teamList = teamGen.convertTeamsToCSVStrings();
                    saveFile(teamList);
                });

                thread.SetApartmentState(ApartmentState.STA);
                thread.IsBackground = true;
                thread.Start();
            }
Exemplo n.º 3
0
        private void launchTeamGenerationThread(GenerateTeams generator, GenerateTeams.League league)
        {
            if (generator == null)
            {
                return;
            }

            TeamCompleteListener listener = new TeamCompleteListener();

            listener.Subscribe(generator);
            Thread generationThread = new Thread(() =>
            {
                generator.createTeams(updateBar, league);
                this.Invoke((MethodInvoker) delegate
                {
                    menuStrip1.Visible = true;
                });
            });

            menuStrip1.Visible            = false;
            generationThread.IsBackground = true;
            generationThread.Start();
        }
Exemplo n.º 4
0
 public void Subscribe(GenerateTeams teamGen)
 {
     teamGen.completeEvent += new GenerateTeams.TeamCompleteHandler(saveTeams);
 }
Exemplo n.º 5
0
            public void saveTeams(GenerateTeams teamGen, EventArgs e)
            {
                Thread thread = new Thread(() =>
                {
                    String teamList = teamGen.convertTeamsToCSVStrings();
                    saveFile(teamList);
                });

                thread.SetApartmentState(ApartmentState.STA);
                thread.IsBackground = true;
                thread.Start();
            }
Exemplo n.º 6
0
        private void launchTeamGenerationThread(GenerateTeams generator, GenerateTeams.League league)
        {
            if (generator == null)
            {
                return;
            }

            TeamCompleteListener listener = new TeamCompleteListener();
            listener.Subscribe(generator);
            Thread generationThread = new Thread(() =>
            {
                generator.createTeams(updateBar, league);
                this.Invoke((MethodInvoker)delegate
                {
                    menuStrip1.Visible = true;
                });
            });

            menuStrip1.Visible = false;
            generationThread.IsBackground = true;
            generationThread.Start();
        }
Exemplo n.º 7
0
 public void Subscribe(GenerateTeams teamGen)
 {
     teamGen.completeEvent += new GenerateTeams.TeamCompleteHandler(saveTeams);
 }