Esempio n. 1
0
        private void makeCBEvent(object sender, EventArgs e)
        {
            if (!_manual || ValueChanged == null)
            {
                return;
            }

            CheckBox cb = sender as CheckBox;

            BCEvent.EVTYPE type = BCEvent.EVTYPE.REPAIR;
            if (cb == chRepair)
            {
                type = BCEvent.EVTYPE.REPAIR;
            }
            if (cb == chNest)
            {
                type = BCEvent.EVTYPE.NEST;
            }
            if (cb == chNest2)
            {
                type = BCEvent.EVTYPE.NEST2;
            }
            if (cb == chDelim)
            {
                type = BCEvent.EVTYPE.DELIM;
            }
            if (cb == chDelim1)
            {
                type = BCEvent.EVTYPE.DELIM1;
            }
            if (cb == chDelim2)
            {
                type = BCEvent.EVTYPE.DELIM2;
            }
            if (cb == chDelim3)
            {
                type = BCEvent.EVTYPE.DELIM3;
            }

            try
            {
                ValueChanged(this, new BCEvent(type, cb.Checked));
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message, "Действие невозможно", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                _manual    = false;
                cb.Checked = !cb.Checked;
                _manual    = true;
            }
        }
Esempio n. 2
0
        private void makeComboEvent(object sender, EventArgs e)
        {
            if (ValueChanged == null)
            {
                return;
            }

            ComboBox cb = sender as ComboBox;

            BCEvent.EVTYPE type = BCEvent.EVTYPE.HEATER;
            if (cb == cbHeater)
            {
                type = BCEvent.EVTYPE.HEATER;
            }
            if (cb == cbHeater2)
            {
                type = BCEvent.EVTYPE.HEATER2;
            }
            if (cb == cbVigul)
            {
                type = BCEvent.EVTYPE.VIGUL;
            }
            ValueChanged(this, new BCEvent(type, cb.SelectedIndex));
        }