private void calculatePlayerStats(Sports sport) { GenerateTeams teamGen = parseFile(sport); if (teamGen != null) { saveFile(teamGen.convertPlayersToValues()); } }
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(); }
public void Subscribe(GenerateTeams teamGen) { teamGen.completeEvent += new GenerateTeams.TeamCompleteHandler(saveTeams); }
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(); }