コード例 #1
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);
            }
        }
コード例 #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);
            }
        }
コード例 #3
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
            }
        }
コード例 #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
            }
        }
コード例 #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);
            }
        }
コード例 #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);
            }
        }