Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            String name = this.textBox1.Text;

            if (String.IsNullOrEmpty(name))
            {
                MessageBox.Show("Missing name", "cb0t", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (AutoIgnores.AddItem(name, this.comboBox1.SelectedIndex, this.comboBox2.SelectedIndex))
            {
                this.dataGridView1.Rows.Add();
                this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1].Cells[0].Value = ((AutoIgnoreCondition)this.comboBox1.SelectedIndex).ToString();
                this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1].Cells[1].Value = this.textBox1.Text;
                this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1].Cells[2].Value = ((AutoIgnoreType)this.comboBox2.SelectedIndex).ToString();
                this.textBox1.Clear();
                this.comboBox1.SelectedIndex = 0;
                this.comboBox2.SelectedIndex = 0;
            }
            else
            {
                MessageBox.Show("Name already filtered", "cb0t", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 2
0
        public void Populate()
        {
            this.comboBox1.SelectedIndex = 0;
            this.comboBox2.SelectedIndex = 0;

            foreach (AutoIgnoreItem o in AutoIgnores.ToArray())
            {
                this.dataGridView1.Rows.Add();
                this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1].Cells[0].Value = o.Condition.ToString();
                this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1].Cells[1].Value = o.Name;
                this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1].Cells[2].Value = o.Action.ToString();
            }
        }
Ejemplo n.º 3
0
        private void removeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.dataGridView1.SelectedRows.Count > 0)
            {
                int index = this.dataGridView1.SelectedRows[0].Index;

                if (index > -1 && index < AutoIgnores.Count)
                {
                    AutoIgnores.RemoveItem(index);
                    DataGridViewRow row = this.dataGridView1.Rows[index];
                    this.dataGridView1.Rows.RemoveAt(index);

                    foreach (DataGridViewCell d in row.Cells)
                    {
                        d.Dispose();
                    }

                    row.Dispose();
                }
            }
        }
Ejemplo n.º 4
0
        private void Eval_Scribble(User user)
        {
            byte[] data = user.ScribbleBuffer.ToArray();
            user.ScribbleBuffer = new List <byte>();

            AutoIgnoreType ai = AutoIgnores.IgnoreType(user.Name);

            if (ai == AutoIgnoreType.All || ai == AutoIgnoreType.Scribble)
            {
                return;
            }

            if (Settings.GetReg <bool>("receive_scribbles", true) && !user.Ignored)
            {
                if (ScriptEvents.OnScribbleReceiving(this, user))
                {
                    data = Zip.Decompress(data);

                    if (user.Name == this.users[0].Name)
                    {
                        this.Panel.Scribble(data);
                    }
                    else if (!user.Ignored)
                    {
                        this.Panel.PMScribbleReceived(this, user, user.Name, data);
                    }
                    else
                    {
                        return;
                    }

                    this.Panel.CheckUnreadStatus();
                    ScriptEvents.OnScribbleReceived(this, user);
                }
            }
        }