Ejemplo n.º 1
0
        public void SetImage(eBoardCellType i_BoardCellType)
        {
            if (i_BoardCellType != m_CurrentCellType)
            {
                if (this.Image != null)
                {
                    this.Image.Dispose();
                    this.Image = null;
                }

                switch (i_BoardCellType)
                {
                case eBoardCellType.Empty:
                    this.Image = Properties.Resources.NoChip;
                    break;

                case eBoardCellType.BlackPlayer:
                    this.Image = Properties.Resources.BlackChip;
                    break;

                case eBoardCellType.WhitePlayer:
                    this.Image = Properties.Resources.WhiteChip;
                    break;

                case eBoardCellType.PossibleMove:
                    this.Image = Properties.Resources.PossibleMoveImage;
                    break;
                }

                m_CurrentCellType = i_BoardCellType;
                this.Refresh();
            }
        }
Ejemplo n.º 2
0
 public GraphicBoardCell(int i_Row, int i_Column, int i_CellWidth, int i_CellHeight, eBoardCellType i_CurrentCellType)
 {
     r_Row         = i_Row;
     r_Column      = i_Column;
     this.Height   = i_CellHeight;
     this.Width    = i_CellWidth;
     this.SizeMode = PictureBoxSizeMode.StretchImage;
     this.Enabled  = false;
     SetImage(i_CurrentCellType);
 }