Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Execute Button
- api.Execute(fastColoredTextBox1.Text);
- // Clear Button
- fastColoredTextBox1.Clear();
- // Open Fiel Button
- OpenFileDialog ofd = new OpenFileDialog();
- ofd.Filter = "Txt Files (*.txt)|*.txt|Lua Files (*.lua)|*.lua";
- if (ofd.ShowDialog() == DialogResult.OK)
- {
- fastColoredTextBox1.Text = File.ReadAllText(ofd.FileName);
- }
- // Execute File Button
- OpenFileDialog ef = new OpenFileDialog();
- ef.Filter = "Txt Files (*.txt)|*.txt|Lua Files (*.lua)|*.lua";
- if (ef.ShowDialog() == DialogResult.OK)
- {
- api.Execute(ef.FileName);
- }
- // Save File Button
- SaveFileDialog sfd = new SaveFileDialog();
- sfd.Filter = "Txt Files (*.txt)|*.txt|Lua Files (*.lua)|*.lua";
- if (sfd.ShowDialog() == DialogResult.OK)
- {
- Stream s = sfd.OpenFile();
- StreamWriter sw = new StreamWriter(s);
- }
- // Attach button
- api.Attach();
- // Form load to load listbox scripts
- DirectoryInfo di = new DirectoryInfo("./Scripts");
- FileInfo[] files = di.GetFiles("*.txt");
- foreach (FileInfo file in files)
- {
- listBox1.Items.Add(file.Name);
- }
- DirectoryInfo di1 = new DirectoryInfo("./Scripts");
- FileInfo[] files1 = di.GetFiles("*.lua");
- foreach (FileInfo file1 in files1)
- {
- listBox1.Items.Add(file1.Name);
- }
- // Listbox selected items
- if (listBox1.SelectedIndex != -1)
- {
- fastColoredTextBox1.Text = File.ReadAllText($"./Scripts/{listBox1.SelectedItem}");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement