public void Add(IStringMatchingRule rule) { if (rule != null) { this._rules.Add(rule); } }
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); }
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)); }
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); }
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); } } }