private void ConfigureBoardCell(out BoardCell bc, int row, int col, TableLayoutPanel tbLayoutPanel) { string controlName = ""; bc = new BoardCell(row, col); bc.BackgroundPainter = PainterFactory.GetBoardStatePainter("UNSELECTED"); bc.BorderPainter = PainterFactory.GetPlainBoarderPainter("UNACTIVE"); bc.ContextMenuStrip = this.cmsRightClick; bc.Dock = System.Windows.Forms.DockStyle.Fill; bc.ProgressType = ProgressODoom.ProgressType.Smooth; bc.ShowPercentage = false; if (col != 0) { controlName = this._posMapScheme.GetBoardName(row + 1, col); //controlName = 'L'+ (row + 1).ToString() + '-'+ col.ToString(); } else { controlName = 'F' + (row + 1).ToString(); } bc.MouseDown += new System.Windows.Forms.MouseEventHandler(this.ProgressBarEx_MouseDown); bc.Text = controlName; bc.Name = "pbeBoardUC" + controlName; bc.Value = 0; tbLayoutPanel.Controls.Add(bc); }
public override void Refresh() { int panelrow = this._boardRowNumber; int panelcol = this._boardColNumber + 1; for (int row = panelrow - 1; row > -1; row--) { for (int col = 0; col < panelcol; col++) { BoardState state = this._model.GetBoardState(_boardList[row, col].Text); this._boardList[row, col].BackgroundPainter = PainterFactory.GetBoardStatePainter(state.ToString()); if (state == BoardState.UNSELECTED) { this._boardList[row, col].BorderPainter = PainterFactory.GetPlainBoarderPainter("UNACTIVE"); } } } if (this.NotifyState != null && this._currentClickBoard != null) { this.NotifyState(this._model.GetBoardState(this.ActiveBoardName), null); } base.Refresh(); }