private void buttonAdd_Click(object sender, EventArgs e) { FormScriptItem fsi = new FormScriptItem(new ScriptItem(), 0); fsi.SaveScriptItem += new FormScriptItem.SaveScriptItemDelegate(SaveNewScriptItem); fsi.ShowDialog(MainForm); }
private void buttonEdit_Click(object sender, EventArgs e) { foreach (ListViewItem item in listScripts.SelectedItems) { ScriptItem scr = new ScriptItem(); scr.ScriptEvent = item.Text; scr.Command = item.SubItems[1].Text; scr.TextMatch = item.SubItems[2].Text; scr.ChannelMatch = item.SubItems[3].Text; scr.Enabled = item.Checked; FormScriptItem fi = new FormScriptItem(scr, item.Index); fi.SaveScriptItem += new FormScriptItem.SaveScriptItemDelegate(UpdateScriptItem); fi.ShowDialog(MainForm); } }