示例#1
0
 public Attribute(JsonReader reader)
 {
     Name  = reader.ReadStringProperty();
     Type  = (AttributeType)reader.ReadIntProperty();
     Value = TextParsers[Type](reader.ReadStringProperty());
     reader.ReadUntilPast(JsonToken.EndObject);
 }
示例#2
0
 public Attribute(XmlAttribute data)
 {
     // Ew dots, put slashes
     Name = data.Name.Replace('.', '/');
     Type = (AttributeType)int.Parse(data.Value[0].ToString());
     // Inner text attributes have an extra line
     Value = TextParsers[Type](data.Value.Substring(Name == _INNERTEXT ? 2 : 1));
 }