Example #1
0
        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;
        }
Example #2
0
        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);
        }