Beispiel #1
0
        public void SetToConfig(int cardId)
        {
            ExternalChannelConfig config = TV3BlasterPlugin.GetExternalChannelConfig(cardId);

            config.CardId = cardId;

            config.PauseTime             = Decimal.ToInt32(numericUpDownPauseTime.Value);
            config.SendSelect            = checkBoxSendSelect.Checked;
            config.DoubleChannelSelect   = checkBoxDoubleSelect.Checked;
            config.RepeatChannelCommands = Decimal.ToInt32(numericUpDownRepeat.Value);

            int chDigits = comboBoxChDigits.SelectedIndex;

            if (chDigits > 0)
            {
                chDigits++;
            }
            config.ChannelDigits = chDigits;

            config.RepeatPauseTime     = Decimal.ToInt32(numericUpDownRepeatDelay.Value);
            config.UsePreChangeCommand = checkBoxUsePreChange.Checked;

            config.SelectCommand    = listViewExternalCommands.Items[10].SubItems[1].Text;
            config.PreChangeCommand = listViewExternalCommands.Items[11].SubItems[1].Text;

            for (int i = 0; i < 10; i++)
            {
                config.Digits[i] = listViewExternalCommands.Items[i].SubItems[1].Text;
            }
        }
Beispiel #2
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            try
            {
                foreach (StbSetup setup in _tvCardStbSetups)
                {
                    setup.Save();
                    TV3BlasterPlugin.GetExternalChannelConfig(setup.CardId).Save();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Failed to save external channel setup", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }

            DialogResult = DialogResult.OK;
            Close();
        }
Beispiel #3
0
        public void SetToCard(int cardId)
        {
            ExternalChannelConfig config = TV3BlasterPlugin.GetExternalChannelConfig(cardId);

            if (config == null)
            {
                MessageBox.Show(this, "You must save your card configurations before copying between card setups",
                                "No saved configration to copy from", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            // Setup command list.
            for (int i = 0; i < 10; i++)
            {
                listViewExternalCommands.Items[i].SubItems[1].Text = config.Digits[i];
            }

            listViewExternalCommands.Items[10].SubItems[1].Text = config.SelectCommand;
            listViewExternalCommands.Items[11].SubItems[1].Text = config.PreChangeCommand;

            // Setup options.
            numericUpDownPauseTime.Value = config.PauseTime;
            checkBoxSendSelect.Checked   = config.SendSelect;
            checkBoxDoubleSelect.Checked = config.DoubleChannelSelect;
            numericUpDownRepeat.Value    = config.RepeatChannelCommands;

            checkBoxDoubleSelect.Enabled = checkBoxSendSelect.Checked;

            int channelDigitsSelect = config.ChannelDigits;

            if (channelDigitsSelect > 0)
            {
                channelDigitsSelect--;
            }
            comboBoxChDigits.SelectedIndex = channelDigitsSelect;

            checkBoxUsePreChange.Checked   = config.UsePreChangeCommand;
            numericUpDownRepeatDelay.Value = new Decimal(config.RepeatPauseTime);
        }