Exemplo n.º 1
0
        public void BlinkDemoHandler(object obj, LEDEventArgs e)
        {
            PictureBoxLED16x16.LED16x16 bm = (PictureBoxLED16x16.LED16x16)obj;
            // copy the current LED image to the picturebox
            thePbox.Image = (Image)bm.displaybitmap;
            Rectangle rect = new Rectangle(0, 0, bm.ledimage.Width, bm.ledimage.Height);

            Invalidate(rect);
        }
Exemplo n.º 2
0
        private void SweeperView_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
        {
            SmileEventArgs ee = new SmileEventArgs(MyResource.Qoo2);

            LEDEventArgs ex = null;

            Notify(ee);

            int x = e.RowIndex;

            int y = e.ColumnIndex;

            if (e.Button == MouseButtons.Left)
            {
                if (!getSetControl.LeftClick(x, y, new Presenter(SetGridImage)))
                {
                    ee = new SmileEventArgs(MyResource.Qoo1);

                    Notify(ee);

                }
            }
            else
                if (e.Button == MouseButtons.Right)
            {

                if (getSetControl.RightClick(x, y, new Presenter(SetFlagImage)))
                {
                    ee = new SmileEventArgs(MyResource.Qoo3);

                    Notify(ee);

                    ex = new LEDEventArgs(getSetControl.Flags.Length);

                    Notify(ex);

                    this.Enabled = this.EnableThis = false;

                    MessageBox.Show("И это победа!", "Уведомление", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    return;


                }

                ex = new LEDEventArgs(getSetControl.Flags.Length);

                Notify(ex);

            }
        }