private void TerritoryGraphViewer_MouseClick(object sender, MouseEventArgs e) { if (CellClick != null)// && e.Button == System.Windows.Forms.MouseButtons.Right) { Point cell = getCellCoord(e); CellClick.Invoke(sender, (UInt32)cell.X, (UInt32)cell.Y, e); } }
public BoardControl(IBoardStyle boardStyle, int bitmapWidth, int bitmapHeight) { this.boardStyle = boardStyle; this.bitmapWidth = bitmapWidth; this.bitmapHeight = bitmapHeight; chessBoard = new DataGridView(); Controls.Add(chessBoard); chessBoard.CellClick += (sender, args) => CellClick?.Invoke(ChessUtils.GetPosition(args.RowIndex, args.ColumnIndex, chessBoard.Rows.Count)); }
void MakePixel(byte x, byte y, byte w) { var pixel = new CellPanel { BorderStyle = BorderStyle.FixedSingle, Location = new Point(x * w, y * w), Size = new Size(w, w), BackColor = Color.Empty, TabIndex = 0, X = x, Y = y }; pixel.Click += (s, e) => { CellClick?.Invoke(e, new CellClickEventArgs { Affected = pixel }); }; pixels[x, y] = pixel; Target.Controls.Add(pixel); }
private void RaiseCellClickEvent(object sender, CellClickEventArgs args) { CellClick?.Invoke(sender, args); }
public virtual void OnCellClick(CellClickEventArgs e) { CellClick?.Invoke(this, e); }
protected virtual void OnCellClick(TreeListCellEventArgs e) { CellClick?.Invoke(this, e); }