예제 #1
0
 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);
     }
 }
예제 #2
0
        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));
        }
예제 #3
0
        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);
        }
예제 #4
0
 private void RaiseCellClickEvent(object sender, CellClickEventArgs args)
 {
     CellClick?.Invoke(sender, args);
 }
예제 #5
0
 public virtual void OnCellClick(CellClickEventArgs e)
 {
     CellClick?.Invoke(this, e);
 }
예제 #6
0
 protected virtual void OnCellClick(TreeListCellEventArgs e)
 {
     CellClick?.Invoke(this, e);
 }