object IXshdVisitor.VisitRule(XshdRule rule) { writer.WriteStartElement("Rule", Namespace); WriteColorReference(rule.ColorReference); writer.WriteString(rule.Regex); writer.WriteEndElement(); return null; }
static XshdRule ParseRule(XmlReader reader) { XshdRule rule = new XshdRule(); SetPosition(rule, reader); rule.ColorReference = ParseColorReference(reader); if (!reader.IsEmptyElement) { reader.Read(); if (reader.NodeType == XmlNodeType.Text) { rule.Regex = reader.ReadContentAsString(); rule.RegexType = XshdRegexType.IgnorePatternWhitespace; } } return rule; }