Пример #1
0
 private bool CheckRuleSet(RuleSet ruleSet)
 {
     List<Rule> rules = ruleSet.GetAllRules();
     foreach (Rule rule in rules)
     {
         if (rule.Action == null || !rule.Action.IsInitialized)
         {
             MessageBox.Show(Resource.FormatString("Wrn_ActionUninitialized", rule.Name));
             return false;
         }
         if (!CheckCondition(rule.Condition))
         {
             return false;
         }
     }
     return true;
 }
 public static TreeNode GetRuleSetTreeNode(RuleSet ruleSet)
 {
     TreeNode ruleSetNode = new TreeNode();
     List<Rule> ruleList = ruleSet.GetAllRules();
     foreach (Rule rule in ruleList)
     {
         TreeNode ruleNode = GetRuleTreeNode(rule);
         ruleSetNode.Nodes.Add(ruleNode);
     }
     ruleSetNode.Tag = ruleSet;
     SetRuleTreeNodeImage(ruleSetNode);
     return ruleSetNode;
 }