// Кнопка Выбрать сигнал(F3) private void button13_Click(object sender, EventArgs e) { try { SignalOutput SO = new SignalOutput(); OpenFileDialog OFD = new OpenFileDialog(); OFD.InitialDirectory = modelsPath; if (OFD.ShowDialog() == DialogResult.OK) { Messages("Выбран файл: " + OFD.FileName); OutputIR = SO.ConvertingBINARYorXMLtoIRsignal(OFD.FileName); if (OutputIR != null) { label1.Enabled = true; button3.Enabled = true; textBox1.Enabled = true; label4.Enabled = true; button7.Enabled = true; textBox3.Enabled = true; button2.Enabled = true; } } SearchRedRat SR = new SearchRedRat(); RedRat3 = SR.FindRedRat(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
// Event for ItemActivate private void listView1_ItemActivate(object sender, EventArgs e) { SignalOutput SO = new SignalOutput(); SearchRedRat SR = new SearchRedRat(); RedRat3 = SR.FindRedRat(); string newPath = pathClick + "\\" + listView1.FocusedItem.Text; if (File.Exists(newPath))//Checker is folder or file { //MessageBox.Show("File is choice!"); //Process.Start(pathClick); OutputIR = SO.ConvertingBINARYorXMLtoIRsignal(newPath); if (OutputIR != null) { Messages("Выбран файл: " + listView1.FocusedItem.Text); label1.Enabled = true; button3.Enabled = true; textBox1.Enabled = true; label4.Enabled = true; button7.Enabled = true; textBox3.Enabled = true; button2.Enabled = true; } } else { AddFoldersWithFileFromEnterPath(newPath, false); } }
// Кнопка вывода одиночного сигнала private void button2_Click(object sender, EventArgs e) { try { if ((RedRat3 != null) && (OutputIR != null)) { SignalOutput SO = new SignalOutput(); SO.OutputOneIRsignal(RedRat3, OutputIR); } else if (OutputIR == null) { MessageBox.Show("Захватите сигнал.", "Вывод сигнала", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }