public override System.Xml.XmlNode ReadFrom(System.Xml.XmlNode parent) { values = new List<LongPauseEventListData>(); XmlElement lpEventsElement = parent.SelectSingleNode("child::" + name) as XmlElement; if (lpEventsElement != null) { XmlNodeList nameElements = lpEventsElement.SelectNodes("child::LpEvent"); foreach (XmlNode nameNode in nameElements) { if (nameNode is XmlElement) { XmlElement eventElement = nameNode as XmlElement; LongPauseEventListData lpEvent = new LongPauseEventListData(); if (eventElement != null && eventElement is XmlElement) { lpEvent.Name = eventElement.Attributes.GetNamedItem("Name").Value; lpEvent.Enabled = Boolean.Parse(eventElement.Attributes.GetNamedItem("Enabled").Value); lpEvent.ReasonCode = Int32.Parse(eventElement.Attributes.GetNamedItem("ReasonCode").Value); values.Add(lpEvent); } } } } return null; }
public LongPauseEventListData Copy() { LongPauseEventListData newData = new LongPauseEventListData(); newData.Name = this.name; newData.Enabled = this.enabled; newData.ReasonCode = this.reasonCode; return newData; }