/// <summary>
        /// Edits the selected rule
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void editButton_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedItem == null)
            {
                return;
            }

            try
            {
                int         idx = listBox1.SelectedIndex;
                Rule        tmp = basicfirewall.rules[idx];
                AddEditRule aer = new AddEditRule(tmp);

                // show dialog and confirm changes
                if (aer.ShowDialog() == DialogResult.OK)
                {
                    // insert the new rule
                    listBox1.Items[idx] = aer.NewRule;
                    List <Rule> r = new List <Rule>();
                    foreach (object rule in listBox1.Items)
                    {
                        r.Add((Rule)rule);
                    }

                    basicfirewall.InstanceGetRuleUpdates(r);
                }
            }
            catch (Exception ex)
            {
                //LogCenter.WriteErrorLog(ex);
            }
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                AddEditRule aer = new AddEditRule();
                if (aer.ShowDialog() == DialogResult.OK)
                {
                    listBox1.Items.Add(aer.NewRule);
                    List <Rule> r = new List <Rule>();
                    foreach (object rule in listBox1.Items)
                    {
                        r.Add((Rule)rule);
                    }

                    basicfirewall.InstanceGetRuleUpdates(r);
                }
            }
            catch (Exception exception)
            {
                LogCenter.Instance.LogException(exception);
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                AddEditRule aer = new AddEditRule();
                if (aer.ShowDialog() == DialogResult.OK)
                {
                    listBox1.Items.Add(aer.NewRule);
                    List <Rule> r = new List <Rule>();
                    foreach (object rule in listBox1.Items)
                    {
                        r.Add((Rule)rule);
                    }

                    basicfirewall.InstanceGetRuleUpdates(r);
                }
            }
            catch (Exception exception)
            {
                //LogCenter.WriteErrorLog(exception);
                //Log Center isn't accessable directly from external modules
            }
        }
Exemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                AddEditRule aer = new AddEditRule();
                if (aer.ShowDialog() == DialogResult.OK)
                {
                    listBox1.Items.Add(aer.NewRule);
                    List<Rule> r = new List<Rule>();
                    foreach (object rule in listBox1.Items)
                    {
                        r.Add((Rule)rule);
                    }

                    basicfirewall.InstanceGetRuleUpdates(r);
                }
            }
            catch (Exception exception)
            {
                //LogCenter.WriteErrorLog(exception);
                //Log Center isn't accessable directly from external modules
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Edits the selected rule
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void editButton_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedItem == null)
                return;

            try
            {
                int idx = listBox1.SelectedIndex;
                Rule tmp = basicfirewall.rules[idx];
                AddEditRule aer = new AddEditRule(tmp);

                // show dialog and confirm changes
                if (aer.ShowDialog() == DialogResult.OK)
                {
                    // insert the new rule
                    listBox1.Items[idx] = aer.NewRule;
                    List<Rule> r = new List<Rule>();
                    foreach (object rule in listBox1.Items)
                    {
                        r.Add((Rule)rule);
                    }

                    basicfirewall.InstanceGetRuleUpdates(r);
                }
            }
            catch (Exception ex)
            {
                //LogCenter.WriteErrorLog(ex);
            }
        }
Exemplo n.º 6
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                AddEditRule aer = new AddEditRule();
                if (aer.ShowDialog() == DialogResult.OK)
                {
                    listBox1.Items.Add(aer.NewRule);
                    List<Rule> r = new List<Rule>();
                    foreach (object rule in listBox1.Items)
                    {
                        r.Add((Rule)rule);
                    }

                    basicfirewall.InstanceGetRuleUpdates(r);
                }
            }
            catch (Exception exception)
            {
                LogCenter.Instance.LogException(exception);
            }
        }