Inheritance: System.Windows.Forms.Form
Esempio n. 1
0
        private void btnExecute_Click(object sender, EventArgs e)
        {
            try {
                scriptResults = new FormChanges();
                scriptResults.Title = "Procedure result";
                var now = DateTime.Now;
                LuaFunctions.EchoEvents.Clear();
                var ret = mod.ExecuteScript(tbCommand.Text);

                foreach (var x in LuaFunctions.EchoEvents) {
                    scriptResults.TextBox.SelectionColor = x.color;
                    scriptResults.TextBox.SelectedText = x.message.Replace("\n", "\r\n");
                }

                if (ret != null) {
                    lbResults.Items.Clear();
                    foreach (var ms in ret) lbResults.Items.Add(ms);
                }
                if (scriptResults.TextBox.TextLength > 0) {
                    var ts = DateTime.Now - now;
                    scriptResults.TextBox.AppendText("\r\n -- Executed in  " + ts.Milliseconds + "ms");
                    scriptResults.TopMost = true;
                    scriptResults.Show();
                }
                ReloadTabs();
            } catch (Exception ex) {
                MessageBox.Show("Error in script:\r\n" + ex.Message, "Script error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Esempio n. 2
0
        private void btnExecute_Click(object sender, EventArgs e)
        {
            try {
                scriptResults       = new FormChanges();
                scriptResults.Title = "Procedure result";
                var now = DateTime.Now;
                LuaFunctions.EchoEvents.Clear();
                var ret = mod.ExecuteScript(tbCommand.Text);

                foreach (var x in LuaFunctions.EchoEvents)
                {
                    scriptResults.TextBox.SelectionColor = x.color;
                    scriptResults.TextBox.SelectedText   = x.message.Replace("\n", "\r\n");
                }

                if (ret != null)
                {
                    lbResults.Items.Clear();
                    foreach (var ms in ret)
                    {
                        lbResults.Items.Add(ms);
                    }
                }
                if (scriptResults.TextBox.TextLength > 0)
                {
                    var ts = DateTime.Now - now;
                    scriptResults.TextBox.AppendText("\r\n -- Executed in  " + ts.Milliseconds + "ms");
                    scriptResults.TopMost = true;
                    scriptResults.Show();
                }
                ReloadTabs();
            } catch (Exception ex) {
                MessageBox.Show("Error in script:\r\n" + ex.Message, "Script error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Esempio n. 3
0
        private void viewChangesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var fc = new FormChanges();

            mod.GetChanges(new Mod(mod.Folder), fc.TextBox);
            if (fc.TextBox.TextLength > 0)
            {
                fc.TopLevel = true;
                fc.TopMost  = true;
                fc.Show();
            }
            else
            {
                MessageBox.Show("No changes detected", "Change detection", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Esempio n. 4
0
 private void viewChangesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     var fc = new FormChanges();
     mod.GetChanges(new Mod(mod.Folder), fc.TextBox);
     if (fc.TextBox.TextLength > 0) {
         fc.TopLevel = true;
         fc.TopMost = true;
         fc.Show();
     } else MessageBox.Show("No changes detected", "Change detection", MessageBoxButtons.OK, MessageBoxIcon.Information);
 }