예제 #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            RulesWizard wizard = new RulesWizard();

            if (wizard.SetupRule(this, _ruleMaster, (Rule)listViewRules.SelectedItems[0].Tag) == DialogResult.OK)
            {
                //_theRule = wizard.Rule;
                if (wizard.Rule != null)
                {
                    listViewRules.SelectedItems[0].Tag  = wizard.Rule;
                    listViewRules.SelectedItems[0].Text = wizard.Rule.Name;
                    //var viewItem = new ListViewItem(_theRule.Name) { Tag = wizard.Rule };
                    //listViewRules.Items.Add(viewItem);
                }
            }
        }
예제 #2
0
        private void newToolStripButton_Click(object sender, EventArgs e)
        {
            RulesWizard wizard = new RulesWizard();

            if (wizard.SetupRule(this, _ruleMaster, new Rule()) == DialogResult.OK)
            {
                _theRule = wizard.Rule;
                if (_theRule != null)
                {
                    var viewItem = new ListViewItem(_theRule.Name, 0)
                    {
                        Tag = _theRule
                    };
                    listViewRules.Items.Add(viewItem);
                }
            }
        }