/// <summary> /// The read xml. /// </summary> /// <param name="reader"> The reader. </param> public void ReadXml(XmlReader reader) { this.list = new List <ITask>(); if (reader.IsEmptyElement) { reader.Skip(); return; } reader.ReadStartElement(); while (reader.NodeType != XmlNodeType.EndElement) { if (reader.NodeType == XmlNodeType.Element) { if (reader.Name == "Child") { XmlWrapper wrapper = new XmlWrapper(); wrapper.ReadXml(reader); this.list.Add(wrapper.Task); } else { reader.Skip(); } } else { reader.Skip(); } } reader.ReadEndElement(); }
/// <summary> /// The equals. /// </summary> /// <param name="other"> The other. </param> /// <returns> The System.Boolean. </returns> public bool Equals(XmlWrapper other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Equals(other.task, this.task)); }
/// <summary> /// The write xml. /// </summary> /// <param name="writer"> The writer. </param> public void WriteXml(XmlWriter writer) { foreach (ITask task in this.list) { if (task == null) { continue; } // Wrap task. XmlWrapper wrapper = new XmlWrapper(task); writer.WriteStartElement("Child"); wrapper.WriteXml(writer); writer.WriteEndElement(); } }
/// <summary> /// The equals. /// </summary> /// <param name="other"> The other. </param> /// <returns> The System.Boolean. </returns> public bool Equals(XmlWrapper other) { if (ReferenceEquals(null, other)) { return false; } if (ReferenceEquals(this, other)) { return true; } return Equals(other.task, this.task); }
/// <summary> /// The read xml. /// </summary> /// <param name="reader"> The reader. </param> public void ReadXml(XmlReader reader) { this.list = new List<ITask>(); if (reader.IsEmptyElement) { reader.Skip(); return; } reader.ReadStartElement(); while (reader.NodeType != XmlNodeType.EndElement) { if (reader.NodeType == XmlNodeType.Element) { if (reader.Name == "Child") { XmlWrapper wrapper = new XmlWrapper(); wrapper.ReadXml(reader); this.list.Add(wrapper.Task); } else { reader.Skip(); } } else { reader.Skip(); } } reader.ReadEndElement(); }