public override void ReadXml(XElement xml) { Id = long.Parse(xml.Attribute("Id").Value); Timestamp = DateTimeOffset.Parse(xml.Attribute("Timestamp").Value); State = xml.Attribute("State").Value; ValidFromDateTime = DateTimeOffset.Parse(xml.Attribute("ValidFromDateTime").Value); if (xml.Attribute("InvalidFromDateTime") != null) { InvalidFromDateTime = DateTimeOffset.Parse(xml.Attribute("InvalidFromDateTime").Value); } DatedVehicleJourneyRef = DatedVehicleJourneyRef.ReadFromXml(xml.Element("DatedVehicleJourneyRef")); AssignedVehicleRef = VehicleRef.ReadFromXml(xml.Element("AssignedVehicleRef")); }
public override void ReadXmlElement(XElement el) { switch (el.Name.LocalName) { case "DatedVehicleJourneyRef": DatedVehicleJourneyRef = DatedVehicleJourneyRef.ReadFromXml(el); break; case "MonitoredVehicleJourneyRef": MonitoredVehicleJourneyId = long.Parse(el.Attribute("Id").Value); break; case "TargetJourneyPatternPointRef": TargetJourneyPatternPointGid = long.Parse(el.Attribute("Gid").Value); break; case "TimetabledJourneyPatternPointRef": TimetabledJourneyPatternPointGid = long.Parse(el.Attribute("Gid").Value); break; } }