private void DrawStat(StatControl statControl, Team team, int goldCount) { if (statControl.InvokeRequired) { statControl.Invoke(new Action(() => { statControl.DrawStat(team, goldCount); })); } else { statControl.DrawStat(team, goldCount); } }
private void DrawTurn(StatControl statControl, Game game) { if (statControl.InvokeRequired) { statControl.Invoke(new Action(() => { statControl.DrawTurn(game); })); } else { statControl.DrawTurn(game); } }
private void MonitorForm_Load(object sender, EventArgs e) { ToolTip toolTip = new ToolTip(); toolTip.AutoPopDelay = 5000; toolTip.InitialDelay = 1000; toolTip.ReshowDelay = 500; toolTip.ShowAlways = true; var boardPanel = gameSplitContainer.Panel1; boardPanel.Controls.Clear(); for (int y = 0; y < Board.Size; y++) { for (int x = 0; x < Board.Size; x++) { var tileControl = new TileControl { Name = GetTileKey(x, y) }; tileControl.MouseClick += OnTileCtrlBtnClick; string positionText = string.Format("{0},{1}", x, y); toolTip.SetToolTip(tileControl, positionText); boardPanel.Controls.Add(tileControl); } } InitBoardPanel(_game, _mapId); var statPanel = statSplitContainer.Panel1; statPanel.Controls.Clear(); for (int i = 0; i < STAT_COUNT; i++) { var statControl = new StatControl { Name = GetStatKey(i), }; statPanel.Controls.Add(statControl); } DrawStats(_game); gameSplitContainer_SplitterMoved(this, null); }