Exemple #1
0
        private void calculatePlayerStats(Sports sport)
        {
            GenerateTeams teamGen = parseFile(sport);

            if (teamGen != null)
            {
                saveFile(teamGen.convertPlayersToValues());
            }
        }
Exemple #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();
            }
Exemple #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();
        }
 public void Subscribe(GenerateTeams teamGen)
 {
     teamGen.completeEvent += new GenerateTeams.TeamCompleteHandler(saveTeams);
 }
            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();
            }
        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();
        }
Exemple #7
0
 public void Subscribe(GenerateTeams teamGen)
 {
     teamGen.completeEvent += new GenerateTeams.TeamCompleteHandler(saveTeams);
 }