private async void btnAllStat_Click(object sender, EventArgs e) { ParseAndVisualize(); List <Game> games = checkBoxLive.Checked ? _liveGames : _allGames; comboBoxPlayers.DataSource = games.GetAllPlayerNames().ToList(); //Debug.WriteLine("Current thread ID - {0}",Thread.CurrentThread.ManagedThreadId); await Task.Run(() => { StatOperator statOperator = null; if (cbAllStats.Checked) { statOperator = new BaseStatOperator(checkBoxLive.Checked, Settings.Default.LiveGamesCount); } else { statOperator = new ConditionalStatOperator(checkBoxLive.Checked); } //Thread.Sleep(5000); var table = statOperator.GetPlayerStatsList(games).ToDataTable(); //Debug.WriteLine("Current thread ID - {0}", Thread.CurrentThread.ManagedThreadId); Invoke((Action) delegate { datGrViewAllStats.DataSource = table; MinimizeGridWidth(); }); }); }
public HudTable(StatOperator statOperator, string path) { _shortPath = System.IO.Path.GetFileNameWithoutExtension(path); var text = PokerFileReader.ReadFileWithWaiting(path); _parser = ParserFactory.CreateParser(_shortPath); _games = _parser.ParseGames(text); _statOperator = statOperator; }
//Оставлен для тестирования и отладки. private void btnStatSyncron_Click(object sender, EventArgs e) { if (_allGames.Count == 0) { ParseAndVisualize(); } List <Game> games = checkBoxLive.Checked ? _liveGames : _allGames; comboBoxPlayers.DataSource = games.GetAllPlayerNames().ToList(); //start diagnostic -------------------------------------------------------------------------- Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); StatOperator statOperator = null; if (cbAllStats.Checked) { statOperator = new BaseStatOperator(checkBoxLive.Checked, Settings.Default.LiveGamesCount); } else { statOperator = new ConditionalStatOperator(checkBoxLive.Checked); } var table = statOperator.GetPlayerStatsList(games).ToDataTable(); datGrViewAllStats.DataSource = table; stopWatch.Stop(); // Get the elapsed time as a TimeSpan value. TimeSpan ts = stopWatch.Elapsed; // Format and display the TimeSpan value. string elapsedTime = $"Time of statistics estimation - {ts.Milliseconds} ms"; //end diagnostic ---------------------------------------------------------------------------- MinimizeGridWidth(); MessageBox.Show(elapsedTime); }
public void RemoveIncreaseStatDelegate(StatOperator del) { _increaseStatOperator -= del; }
public void AddIncreaseStatDelegate(StatOperator del) { _increaseStatOperator += del; }
public void RemoveMoreStatDelegate(StatOperator del) { _moreStatOperator -= del; }
public void AddMoreStatDelegate(StatOperator del) { _moreStatOperator += del; }