private void EditSelectedItem()
        {
            if (_scriptsList.SelectedItems.Count == 1)
            {
                ListViewItem lvi = _scriptsList.SelectedItems[0];
                var index = (int)lvi.Tag;

                var d = new EditScriptDialog(_scripts[index], "Edit", index);

                d.Text = string.Format("Edit Script {0}", (int)index);

                d.ShowDialog();

                if (d.DialogResult == DialogResult.OK)
                {
                    _scripts[index] = d.Script;

                    RefreshScriptsList();
                }
            }
        }
        private void _addButton_Click(object sender, EventArgs e)
        {
            int index = -1;

            for (int i = 0; i < _scripts.Count; ++i)
            {
                if (_scripts[i] == null)
                {
                    index = i;
                    break;
                }
            }

            if (index < 0)
            {
                MessageBox.Show(string.Format("This build has a limit of {0} scripts.\n\nRecompile the package if this isn't enough...", PkgCmdIDList.numScripts), "Script limit");
                return;
            }

            var d = new EditScriptDialog(new Script(), "Add", index);

            d.ShowDialog();

            if (d.DialogResult == DialogResult.OK)
            {
                _scripts[index] = d.Script;

                RefreshScriptsList();
            }
        }