public override object ReadObject(XmlReader reader) { TwoWayResponse TwoWayResponseField = null; if (IsParentStartElement(reader, false, true)) { TwoWayResponseField = new TwoWayResponse(); TwoWayResponseField.AnyAttr = ReadAnyAttribute(reader); reader.Read(); if (IsChildStartElement(reader, "Sum", false, true)) { reader.Read(); TwoWayResponseField.Sum = XmlConvert.ToInt32(reader.ReadString()); reader.ReadEndElement(); } TwoWayResponseField.Any = ReadAnyElement(reader, false); reader.ReadEndElement(); } return(TwoWayResponseField); }
public override object ReadObject(XmlReader reader) { FileInfo FileInfoField = null; if (IsParentStartElement(reader, false, true)) { FileInfoField = new FileInfo(); reader.Read(); if (IsChildStartElement(reader, "Name", true, false)) { reader.Read(); FileInfoField.Name = reader.ReadString(); reader.ReadEndElement(); } if (IsChildStartElement(reader, "Size", false, false)) { reader.Read(); FileInfoField.Size = XmlConvert.ToInt32(reader.ReadString()); reader.ReadEndElement(); } reader.ReadEndElement(); } return(FileInfoField); }
public override object ReadObject(XmlReader reader) { Measurement MeasurementField = null; if (IsParentStartElement(reader, false, true)) { MeasurementField = new Measurement(); reader.Read(); if (IsChildStartElement(reader, "Light", false, false)) { reader.Read(); MeasurementField.Light = XmlConvert.ToDouble(reader.ReadString()); reader.ReadEndElement(); } if (IsChildStartElement(reader, "Moisture", false, false)) { reader.Read(); MeasurementField.Moisture = XmlConvert.ToInt32(reader.ReadString()); reader.ReadEndElement(); } if (IsChildStartElement(reader, "Temperature", false, false)) { reader.Read(); MeasurementField.Temperature = XmlConvert.ToDouble(reader.ReadString()); reader.ReadEndElement(); } if (IsChildStartElement(reader, "Time", false, false)) { reader.Read(); MeasurementField.Time = XmlConvert.ToDateTime(reader.ReadString()); reader.ReadEndElement(); } reader.ReadEndElement(); } return(MeasurementField); }