private void ShowLedDialog(LedProperty led)
        {
            LedProperty newLed = new LedProperty();

            CopyLedProperty(led, newLed);

            DialogLedProperty dialog = new DialogLedProperty(mode, newLed, StringCount, LedCount);

            dialog.Text = $"LED - X:{led.X + 1}, Y:{led.Y + 1}";

            try
            {
                dialog.ShowDialog();
            }
            finally
            {
                if (dialog.DialogResult == DialogResult.OK)
                {
                    if ((mode == EPatternDispMode.String) && (newLed.Type == ELedType.Enabled))
                    {
                        if (IsExistStringLedNo(newLed.StringIndex, newLed.LedIndex) == true)
                        {
                            MessageBox.Show("StringNo and LedNo are already existed!",
                                            AppRes.Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                        else
                        {
                            CopyLedProperty(newLed, led);
                        }
                    }
                    else
                    {
                        CopyLedProperty(newLed, led);
                    }
                }
            }
        }
Beispiel #2
0
        private void patternGridView_MouseDown(object sender, MouseEventArgs e)
        {
            GridView    view = sender as GridView;
            GridHitInfo hit  = view.CalcHitInfo(e.Location);

            if (hit == null)
            {
                return;
            }

            switch (hit.HitTest)
            {
            case GridHitTest.RowCell:
                DialogLedProperty dialog = new DialogLedProperty();
                try
                {
                    dialog.ShowDialog();
                }
                finally
                {
                }
                break;
            }
        }