private void T_Manager_SelectedIndexChanged(object sender, EventArgs e) { if (T_Manager.SelectedIndex != -1) { bool isPlus = false; Text_Japanese.Text = ""; Text_Russian.Text = ""; string filename = T_Manager.GetItemText(T_Manager.Items[T_Manager.SelectedIndex]); StreamReader read = new StreamReader(@filename); string line = ""; while ((line = read.ReadLine()) != null) { if (line == "+") { if ((line = read.ReadLine()) != null) { isPlus = true; } } if (!isPlus) { Text_Japanese.Text += line; } else { Text_Russian.Text += line; } } read.Close(); Button_Anki_Text_Start.Enabled = true; Text_Anki_Text_Russian_Sentence.Text = "Вы выбрали текст: " + filename + "." + Environment.NewLine + "Нажмите НАЧАТЬ для старта."; } }
private void Button_Text_Del_Click(object sender, EventArgs e) { string filename = T_Manager.GetItemText(T_Manager.Items[T_Manager.SelectedIndex]); DialogResult dr = new DialogResult(); Form2 dial = new Form2(); dr = dial.ShowDialog(); if (dr == DialogResult.OK) { Text text = new Text(this); text.Delete_Text(filename); } }