コード例 #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
ファイル: FTable.cs プロジェクト: xingqingxiang/WinForm.UI
 public virtual void OnCellClick(CellClickEventArgs e)
 {
     CellClick?.Invoke(this, e);
 }
コード例 #6
0
 protected virtual void OnCellClick(TreeListCellEventArgs e)
 {
     CellClick?.Invoke(this, e);
 }