Beispiel #1
0
        public FormScriptItem(ScriptItem src, int index)
        {
            InitializeComponent();
            comboScriptEvent.Items.Add("Channel Message");
            comboScriptEvent.Items.Add("Channel Action");
            comboScriptEvent.Items.Add("Private Message");
            comboScriptEvent.Items.Add("Private Action");
            comboScriptEvent.Items.Add("Channel Join");

            this.scriptItem = src;
            this.listIndex = index;

            textTextMatch.Text = scriptItem.TextMatch;
            textCommand.Text = scriptItem.Command;
            textChannelMatch.Text = scriptItem.ChannelMatch;
            comboScriptEvent.Text = scriptItem.ScriptEvent;
        }
Beispiel #2
0
 public void AddScriptItem(ScriptItem scr)
 {
     listScripts.Add(scr);
 }
Beispiel #3
0
 private void UpdateScriptItem(ScriptItem scr, int listIndex)
 {
     foreach (ListViewItem item in listScripts.SelectedItems)
     {
         if (item.Index == listIndex)
         {
             item.Text= scr.ScriptEvent;
             item.SubItems[1].Text = scr.Command;
             item.SubItems[2].Text = scr.TextMatch;
             item.SubItems[3].Text = scr.ChannelMatch;
             item.Checked = scr.Enabled;
             break;
         }
     }
 }
Beispiel #4
0
 private void SaveNewScriptItem(ScriptItem scr, int listIndex)
 {
     if (scr.TextMatch.Length > 0)
     {
         ListViewItem lvi = this.listScripts.Items.Add(scr.ScriptEvent);
         lvi.SubItems.Add(scr.Command);
         lvi.SubItems.Add(scr.TextMatch);
         lvi.SubItems.Add(scr.ChannelMatch);
         lvi.Checked = true;
     }
 }
Beispiel #5
0
        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);
            }
        }
Beispiel #6
0
        public override void SaveEditorForm()
        {
            iceChatScripts.listScripts.Clear();

            foreach (ListViewItem item in listScripts.Items)
            {
                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;
                iceChatScripts.AddScriptItem(scr);
            }

            SaveScriptSettings();
        }
Beispiel #7
0
 public void AddScriptItem(ScriptItem scr)
 {
     listScripts.Add(scr);
 }