Exemplo n.º 1
0
        /// <summary>
        /// Edits Range or Adds Range.
        /// </summary>
        public static bool EditRange(ICollection <int> range)
        {
            if (range == null)
            {
                throw new ArgumentNullException(nameof(range));
            }

            FrmRangeEdit frmRange = new FrmRangeEdit();

            frmRange.txtRange.Text = RangeUtils.RangeToStr(range);

            if (frmRange.ShowDialog() == DialogResult.OK)
            {
                range.Clear();

                foreach (int val in frmRange.resultRange)
                {
                    range.Add(val);
                }

                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        private void btnEditCnlNum_Click(object sender, EventArgs e)
        {
            if (triggerOptions != null)
            {
                if (FrmRangeEdit.EditRange(triggerOptions.CnlNums))
                {
                    txtCnlNum.Text      = RangeUtils.RangeToStr(triggerOptions.CnlNums);
                    txtCnlNum.ForeColor = Color.FromKnownColor(KnownColor.WindowText);

                    if (txtCnlNum.Text == "")
                    {
                        chkSingleQuery.Checked = false;
                        chkSingleQuery.Enabled = false;
                    }
                    else
                    {
                        chkSingleQuery.Enabled = true;
                    }

                    OnTriggerOptionsChanged();
                }
            }

            txtCnlNum.Select();
            txtCnlNum.DeselectAll();
        }
Exemplo n.º 3
0
        private void btnEditDeviceNum_Click(object sender, EventArgs e)
        {
            if (eventTiggerOptions != null)
            {
                if (FrmRangeEdit.EditRange(eventTiggerOptions.DeviceNums))
                {
                    txtDeviceNum.Text      = RangeUtils.RangeToStr(eventTiggerOptions.DeviceNums);
                    txtDeviceNum.ForeColor = Color.FromKnownColor(KnownColor.WindowText);

                    OnEventTriggerOptionsChanged();
                }
            }

            txtDeviceNum.Select();
            txtDeviceNum.DeselectAll();
        }