/// <summary>Initializes a new instance of RssTextInput</summary> public RssTextInput(System.Xml.XmlReader xmlTextReader) { if (xmlTextReader.IsEmptyElement) { return; } // bool supressRead = false; while (!(xmlTextReader.Name == "textInput" && xmlTextReader.NodeType == XmlNodeType.EndElement)) { // Continue read if (!supressRead) { xmlTextReader.Read(); } xmlTextReader.MoveToContent(); // supressRead = false; if (xmlTextReader.NodeType != XmlNodeType.Element) { continue; } supressRead = XmlSerializationUtil.DecodeXmlTextReaderValue(this, xmlTextReader); } }
/// <summary>Initializes a new instance</summary> public RssImage(System.Xml.XmlReader xmlTextReader) { if (xmlTextReader.IsEmptyElement) { return; } // bool supressRead = false; while (!(xmlTextReader.Name == "image" && xmlTextReader.NodeType == XmlNodeType.EndElement)) { // Continue read if (!supressRead) { xmlTextReader.Read(); } xmlTextReader.MoveToContent(); supressRead = false; if (xmlTextReader.NodeType != XmlNodeType.Element) { continue; } // find related property by name supressRead = XmlSerializationUtil.DecodeXmlTextReaderValue(this, xmlTextReader); } }
/// <summary>Initializes a new instance of RssCloud</summary> public RssCloud(System.Xml.XmlReader xmlTextReader) { if (!xmlTextReader.HasAttributes) { return; } // System.Reflection.PropertyInfo propertyInfo = null; // while (xmlTextReader.MoveToNextAttribute()) { // find related property by name propertyInfo = GetType().GetProperty(xmlTextReader.Name, System.Reflection.BindingFlags.IgnoreCase | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance); if (propertyInfo != null) { // Protocol enum needs some conversion before the typeconverter can set the values that contains - char if (propertyInfo.Name == "Protocol") { propertyInfo.SetValue(this, System.ComponentModel.TypeDescriptor.GetConverter(propertyInfo.PropertyType).ConvertFromString(xmlTextReader.ReadInnerXml().Trim().Replace("-", "")), null); } else { XmlSerializationUtil.DecodeXmlTextReaderValue(this, xmlTextReader); } } } }
/// <summary>Initializes a new instance of RssEnclosure</summary> public RssEnclosure(System.Xml.XmlReader xmlTextReader) { System.Diagnostics.Debug.Assert(xmlTextReader.HasAttributes); // while (xmlTextReader.MoveToNextAttribute()) { XmlSerializationUtil.DecodeXmlTextReaderValue(this, xmlTextReader); } }
/// <summary>Initializes a new instance</summary> public RssItem(System.Xml.XmlReader xmlTextReader) : this() { if (xmlTextReader.IsEmptyElement) { return; } // System.Diagnostics.Debug.Assert(!xmlTextReader.IsEmptyElement); bool supressRead = false; // fill new item with the provided data while (!(xmlTextReader.Name == "item" && xmlTextReader.NodeType == XmlNodeType.EndElement)) { // Continue read if (!supressRead) { xmlTextReader.Read(); } xmlTextReader.MoveToContent(); // supressRead = false; if (xmlTextReader.NodeType != System.Xml.XmlNodeType.Element) { continue; } // find related property by name if (xmlTextReader.Name == "enclosure") { if (!xmlTextReader.HasAttributes) { continue; } this.Enclosure = new RssEnclosure(xmlTextReader); } else if (xmlTextReader.Name == "guid") { supressRead = !xmlTextReader.IsEmptyElement; this.Guid = new RssGuid(xmlTextReader); } else if (xmlTextReader.Name == "source") { supressRead = !xmlTextReader.IsEmptyElement; this.Source = new RssSource(xmlTextReader); } else if (!xmlTextReader.IsEmptyElement) { supressRead = XmlSerializationUtil.DecodeXmlTextReaderValue(this, xmlTextReader); } } }
/// <summary>Initializes a new instance of RssGuid</summary> public RssGuid(System.Xml.XmlReader xmlTextReader) : this() { bool emptyElement = xmlTextReader.IsEmptyElement; while (xmlTextReader.MoveToNextAttribute()) { XmlSerializationUtil.DecodeXmlTextReaderValue(this, xmlTextReader); } if (emptyElement) { return; } // xmlTextReader.MoveToElement(); XmlSerializationUtil.DecodeXmlTextReaderValue(this, this.GetType().GetProperty("Value"), xmlTextReader); }
/// <summary>Initializes a new instance of OpmlHead</summary> public OpmlHead(System.Xml.XmlReader xmlTextReader) : this() { bool supressRead = false; System.Reflection.PropertyInfo propertyInfo = null; while (!(xmlTextReader.Name == "head" && xmlTextReader.NodeType == XmlNodeType.EndElement)) { // Continue read if (!supressRead) { xmlTextReader.Read(); } xmlTextReader.MoveToContent(); // find related property by name propertyInfo = GetType().GetProperty(xmlTextReader.Name, System.Reflection.BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.Instance); if (propertyInfo != null) { supressRead = XmlSerializationUtil.DecodeXmlTextReaderValue(this, xmlTextReader); } } }