Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. List<String> fullFileName;
  2. List<String> fullFileName2;
  3. List<string> selectedScripts = new List<string>();
  4.  
  5. public void listBox3_SelectedIndexChanged(object sender, EventArgs e)
  6. {
  7. if (listBox3.SelectedIndex >= 0)
  8. {
  9. string fullFileName2 = selectedScripts[listBox3.SelectedIndex];
  10. textBox3.Text = fullFileName2;
  11. string File1 = fullFileName2;
  12. string text = System.IO.File.ReadAllText(File1);
  13. textEditorControl1.Text = text;
  14. textEditorControl1.Refresh();
  15. }
  16. else
  17. {
  18.  
  19. }
  20.  
  21. private void materialFlatButton10_Click(object sender, EventArgs e)
  22. {
  23. OpenFileDialog OpenFileDialog1 = new OpenFileDialog();
  24. OpenFileDialog1.Multiselect = true;
  25. OpenFileDialog1.Filter = "Text Files|*.txt|All Files|*.*|Lua Files|*.lua";
  26. OpenFileDialog1.Title = "Select a Text/Lua File";
  27. if (OpenFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  28. {
  29. fullFileName2 = new List<String>(OpenFileDialog1.FileNames);
  30.  
  31.  
  32. foreach (string s in OpenFileDialog1.FileNames)
  33. {
  34. listBox3.Items.Add(Path.GetFileName(s));
  35. selectedScripts.Add(s);
  36. }
  37.  
  38.  
  39. }
  40. }
  41.  
  42.  
  43.  
  44. private void deleteFromListToolStripMenuItem_Click(object sender, EventArgs e)
  45. {
  46. label4.Text = " ";
  47. textBox3.Text = "";
  48. IDocument document = textEditorControl1.Document;
  49. document.Remove(0, document.TextLength);
  50. textEditorControl1.Refresh();
  51. selectedScripts.Clear();
  52.  
  53. for (int i = listBox3.SelectedIndices.Count - 1; i >= 0; i--)
  54. {
  55. listBox3.Items.RemoveAt(listBox3.SelectedIndices[i]);
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement