Пример #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());
                }
            }
        }
Пример #2
0
 public JsxProperty(String name, IJsxValue value, String suite)
 {
     this.name  = name;
     this.value = value;
     this.suite = (suite != null && suite.Length > 0) ? suite : null;
 }