public IMemberValue Read(INXmlElementReader nodeReader, IDataType type) { var fieldName = nodeReader.Attributes.Get("name"); var field = type.GetField(fieldName); if (field == null) { throw new UnableToReadXMLTextException( string.Format("Unable to find field '{0}'.", fieldName)); } IMemberValue value; using (var valueNode = nodeReader.GetNextChildNode()) { value = new FieldValue(field, objectReader.Get(valueNode)); } return value; }
public IMemberValue Read(INXmlElementReader nodeReader, IDataType type) { var fieldName = nodeReader.Attributes.Get("name"); var field = type.GetField(fieldName); if (field == null) { throw new UnableToReadXMLTextException( string.Format("Unable to find field '{0}'.", fieldName)); } IMemberValue value; using (var valueNode = nodeReader.GetNextChildNode()) { value = new FieldValue(field, objectReader.Get(valueNode)); } return(value); }