private void open_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog() == DialogResult.OK) { openFileName.Text = openFileDialog.FileName; Input.InputInterface inputInstance = null; try { inputInstance = Input.InputFactory.GetInstance(openFileDialog.FileName); } catch (Exception exp) { MessageBox.Show(exp.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } channels = inputInstance.GetChannels(); inputFileInfo.Text = string.Empty; for (int i = 0; i < channels.Count; i++) { inputFileInfo.Text += "Channel " + (i + 1) + ":\r\n"; inputFileInfo.Text += channels[i].ToString(); inputFileInfo.Text += "\r\n"; } saveFileName.Text = Path.GetDirectoryName(openFileName.Text) + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(openFileName.Text) + GetOutputFileExtension(); } }
private void open_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog() == DialogResult.OK) { openFileName.Text = openFileDialog.FileName; Input.InputInterface inputInstance = Input.InputFactory.GetInstance(openFileDialog.FileName); channels = inputInstance.GetChannels(); inputFileInfo.Text = string.Empty; for (int i = 0; i < channels.Count; i++) { inputFileInfo.Text += "Канал " + (i + 1) + ":\r\n"; inputFileInfo.Text += channels[i].ToString(); inputFileInfo.Text += "\r\n"; } } }