コード例 #1
0
        private void buttonNewIR_Click(object sender, EventArgs e)
        {
            _learnIR = new IREditor(
                new LearnIrDelegate(Tray.LearnIR),
                new BlastIrDelegate(Tray.BlastIR),
                Tray.TransceiverInformation.Ports);

            _learnIR.ShowDialog(this);

            _learnIR = null;

            RefreshIRList();
        }
コード例 #2
0
        private void EditIR()
        {
            if (listViewIR.SelectedItems.Count != 1)
            {
                return;
            }

            try
            {
                string command  = listViewIR.SelectedItems[0].Text;
                string fileName = Path.Combine(Common.FolderIRCommands, command + Common.FileExtensionIR);

                if (File.Exists(fileName))
                {
                    _learnIR = new IREditor(
                        new LearnIrDelegate(Tray.LearnIR),
                        new BlastIrDelegate(Tray.BlastIR),
                        Tray.TransceiverInformation.Ports,
                        command);

                    _learnIR.ShowDialog(this);

                    _learnIR = null;
                }
                else
                {
                    RefreshIRList();

                    throw new FileNotFoundException("IR file missing", fileName);
                }
            }
            catch (Exception ex)
            {
                IrssLog.Error(ex);
                MessageBox.Show(this, ex.Message, "Failed to edit IR file", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }