Ejemplo n.º 1
0
 public void Add(IStringMatchingRule rule)
 {
     if (rule != null)
     {
         this._rules.Add(rule);
     }
 }
Ejemplo n.º 2
0
        public void LoadXml(XElement InputXml)
        {
            if (InputXml == null)
            {
                return;
            }
            foreach (XElement subx in InputXml.Elements())
            {
                IStringMatchingRule newrule = MatchingRuleFactory.GetRuleObject(subx, this._owner);
                if (newrule != null)
                {
                    this._rules.Add(newrule);
                }
            }

            XAttribute xa = InputXml.Attribute("Type");

            if (xa != null)
            {
                if (xa.Value == "AND")
                {
                    this._ruletype = AndOr.AND;
                }
            }

            this.Not = XmlHandler.GetBoolFromXAttribute(InputXml, "Not", this.Not);
        }
Ejemplo n.º 3
0
        public bool RuleTest(string TestString, string RuleString, string SearchType, bool CaseSensitive)
        {
            XElement xrule = new XElement("Rule", RuleString);

            xrule.Add(new XAttribute("Type", SearchType));
            IStringMatchingRule rule = MatchingRuleFactory.GetRuleObject(xrule, new DummyLinkTarget());

            return(rule.DoesMatch(TestString));
        }
Ejemplo n.º 4
0
        public static IStringMatchingRule GetRootRuleObject(XElement InputXml, ILinkTarget linktarget)
        {
            IStringMatchingRule newrule = GetRuleObject(InputXml, linktarget);
            RuleSet             testset = newrule as RuleSet;

            if (testset != null)
            {
                testset.IsChild = false;
            }
            return(newrule);
        }
Ejemplo n.º 5
0
 public void LoadXml(XElement InputXml)
 {
     if (InputXml == null)
     {
         return;
     }
     foreach (XElement subx in InputXml.Elements())
     {
         IStringMatchingRule newrule = MatchingRuleFactory.GetRootRuleObject(subx, this._owner);
         if (newrule != null)
         {
             this.Rules.Add(newrule);
         }
     }
 }