Пример #1
0
        public override void Validate(Context context, JsxProperty property)
        {
            IJsxValue value = property.GetValue();

            if (value.IsLiteral())
            {
                String text = value.ToString();
                if (text.StartsWith("\"") && text.EndsWith("\""))
                {
                    text = text.Substring(1, text.Length - 1);
                }
                if (!values.Contains(text))
                {
                    throw new SyntaxError("Illegal value " + value.ToString());
                }
            }
        }