Exemple #1
0
        private void buttonRuleEdit_Click(object sender, EventArgs e)
        {
            if (_selectedFolderIndex < 0)
            {
                MessageBox.Show("Please select a folder.");
                return;
            }
            if (_selectedRuleIndex < 0)
            {
                MessageBox.Show("Please select a rule.");
                return;
            }
            FormCreateARule form = new FormCreateARule();

            BRule r = _folders[_selectedFolderIndex].Rules[_selectedRuleIndex];

            form.Description   = r.Description;
            form.IsEnabled     = r.Enabled;
            form.ConfirmAction = r.ConfirmAction;
            form.Recursive     = r.Recursive;
            form.AllOrAny      = r.AllOrAny;
            form.Conditions    = r.Conditions;
            form.Action        = r.Action;

            DialogResult dr = form.ShowDialog();

            if (dr != DialogResult.OK)
            {
                return;
            }

            r.Description   = form.Description;
            r.Enabled       = form.IsEnabled;
            r.ConfirmAction = form.ConfirmAction;
            r.Recursive     = form.Recursive;
            r.AllOrAny      = form.AllOrAny;
            r.Conditions    = form.Conditions;
            r.Action        = form.Action;

            listViewRules.BeginUpdate();
            ListViewItem l = listViewRules.Items[_selectedRuleIndex];

            l.Text    = r.Description;
            l.Checked = r.Enabled;
            listViewRules.EndUpdate();
        }
Exemple #2
0
        private void buttonRuleAdd_Click(object sender, EventArgs e)
        {
            if (_selectedFolderIndex < 0)
            {
                MessageBox.Show("Please select a folder.");
                return;
            }
            BFolder         folder = _folders[_selectedFolderIndex];
            FormCreateARule form   = new FormCreateARule();

            form.Path = folder.Path;
            DialogResult dr = form.ShowDialog();

            if (dr != DialogResult.OK)
            {
                return;
            }

            BRule r = new BRule();

            r.Description   = form.Description;
            r.Enabled       = form.IsEnabled;
            r.ConfirmAction = form.ConfirmAction;
            r.Recursive     = form.Recursive;
            r.AllOrAny      = form.AllOrAny;
            r.Conditions    = form.Conditions;
            r.Action        = form.Action;

            folder.Rules.Add(r);
            listViewRules.BeginUpdate();
            ListViewItem l = new ListViewItem(r.Description);

            l.Checked = r.Enabled;
            listViewRules.Items.Add(l);
            listViewRules.EndUpdate();
        }
Exemple #3
0
        private void buttonRuleEdit_Click(object sender, EventArgs e)
        {
            if (_selectedFolderIndex < 0)
            {
                MessageBox.Show("Please select a folder.");
                return;
            }
            if (_selectedRuleIndex < 0)
            {
                MessageBox.Show("Please select a rule.");
                return;
            }
            FormCreateARule form = new FormCreateARule();

            BRule r = _folders[_selectedFolderIndex].Rules[_selectedRuleIndex];
            form.Description = r.Description;
            form.IsEnabled = r.Enabled;
            form.ConfirmAction = r.ConfirmAction;
            form.Recursive = r.Recursive;
            form.AllOrAny = r.AllOrAny;
            form.Conditions = r.Conditions;
            form.Action = r.Action;

            DialogResult dr = form.ShowDialog();
            if (dr != DialogResult.OK)
                return;

            r.Description = form.Description;
            r.Enabled = form.IsEnabled;
            r.ConfirmAction = form.ConfirmAction;
            r.Recursive = form.Recursive;
            r.AllOrAny = form.AllOrAny;
            r.Conditions = form.Conditions;
            r.Action = form.Action;

            listViewRules.BeginUpdate();
            ListViewItem l = listViewRules.Items[_selectedRuleIndex];
            l.Text = r.Description;
            l.Checked = r.Enabled;
            listViewRules.EndUpdate();
        }
Exemple #4
0
        private void buttonRuleAdd_Click(object sender, EventArgs e)
        {
            if (_selectedFolderIndex < 0)
            {
                MessageBox.Show("Please select a folder.");
                return;
            }
            BFolder folder = _folders[_selectedFolderIndex];
            FormCreateARule form = new FormCreateARule();
            form.Path = folder.Path;
            DialogResult dr = form.ShowDialog();
            if (dr != DialogResult.OK)
                return;

            BRule r = new BRule();
            r.Description = form.Description;
            r.Enabled = form.IsEnabled;
            r.ConfirmAction = form.ConfirmAction;
            r.Recursive = form.Recursive;
            r.AllOrAny = form.AllOrAny;
            r.Conditions = form.Conditions;
            r.Action = form.Action;

            folder.Rules.Add(r);
            listViewRules.BeginUpdate();
            ListViewItem l = new ListViewItem(r.Description);
            l.Checked = r.Enabled;
            listViewRules.Items.Add(l);
            listViewRules.EndUpdate();
        }