Class RulesUtility
- Namespace
- Dynamicweb.Content.Items.Queries.Rules
- Assembly
- Dynamicweb.dll
Provides methods and properties for working with smart filter rules. This class cannot be inherited.
public sealed class RulesUtility
- Inheritance
-
RulesUtility
- Inherited Members
Fields
ValueSeparator
Gets or sets the value separator.
public const char ValueSeparator = ','
Field Value
Methods
GetXmlAttributeValue(XmlAttributeCollection, string)
Get the xml attribute value by attribute name
public static string GetXmlAttributeValue(XmlAttributeCollection attributes, string name)
Parameters
attributes
XmlAttributeCollectionAttributes collection
name
stringAttribute name
Returns
Matches(string, Rule)
Determines whether the given test value matches the given rule.
public static bool Matches(string testValue, Rule rule)
Parameters
Returns
- bool
Value indicating whether the given test value matches the given recognition rule constraint.
Matches(string, Rule, bool)
Determines whether the given test value matches the given rule.
public static bool Matches(string testValue, Rule rule, bool decomposeValue)
Parameters
testValue
stringTest value.
rule
RuleRecognition rule.
decomposeValue
boolValue indicating whether to decompose both test value and constraint value (using ValueSeparator) and compere their components instead.
Returns
- bool
Value indicating whether the given test value matches the given recognition rule constraint.
ParseRules(string)
Parses the recognition expression from the given XML representation.
public static RulesGroupCollection ParseRules(string xmlData)
Parameters
xmlData
stringXML string representing an expression.
Returns
- RulesGroupCollection
Parsed expression.