Beispiel #1
0
        private void addNewRule(rule toAdd)
        {
            // if the rule is toolbox promoted it shouldn't appear in the list of runnable rules instead add it to the custom toolbox list
            // which will be added to the rule editors box
            if (toAdd.toolboxPromoted)
            {
             //   _customToolbox.Add(new ruleItemCustom(toAdd));
            }
            else
            {
                // Create a new rule, and add it to our listView.
                // Add the new rule's state and name as columns, and the rule object itself as a tag.
                ListViewItem newItem = new ListViewItem();

                toAdd.onStatusUpdate += updateRuleIcon;
                newItem.SubItems.Add(toAdd.name);
                newItem.SubItems.Add(false.ToString());
                if (toAdd.isErrored)
                    newItem.SubItems.Add(toAdd.getError().Message);
                newItem.Tag = toAdd;

                lstRules.Items.Add(newItem);

                updateRuleIcon(toAdd);
            }
        }