예제 #1
0
        object IXshdVisitor.VisitRuleSet(XshdRuleSet ruleSet)
        {
            writer.WriteStartElement("RuleSet", Namespace);

            if (ruleSet.Name != null)
            {
                writer.WriteAttributeString("name", ruleSet.Name);
            }
            WriteBoolAttribute("ignoreCase", ruleSet.IgnoreCase);

            ruleSet.AcceptElements(this);

            writer.WriteEndElement();
            return(null);
        }
            public object VisitRuleSet(XshdRuleSet ruleSet)
            {
                HighlightingRuleSet hrs = new HighlightingRuleSet();

                ruleSets.Add(ruleSet, hrs);
                if (ruleSet.Name != null)
                {
                    if (ruleSet.Name.Length == 0)
                    {
                        throw Error(ruleSet, "Name must not be the empty string");
                    }
                    if (def.ruleSetDict.ContainsKey(ruleSet.Name))
                    {
                        throw Error(ruleSet, "Duplicate rule set name '" + ruleSet.Name + "'.");
                    }

                    def.ruleSetDict.Add(ruleSet.Name, hrs);
                }
                ruleSet.AcceptElements(this);
                return(null);
            }