Пример #1
0
 /// <summary>Writes the contents of this SyndicationContent object to the specified XmlWriter.</summary>
 /// <param name='writer'>The XmlWriter to write to.</param>
 private void WritePropertyContentsTo(XmlWriter writer)
 {
     for (int i = 0; i < this.valueNames.Count; i++)
     {
         string propertyName     = this.valueNames[i];
         string propertyTypeName = this.valueTypes[i];
         object propertyValue    = this.valueContents[i];
         if (propertyValue == null)
         {
             PlainXmlSerializer.WriteNullValue(writer, propertyName, propertyTypeName);
         }
         else if (propertyValue is DictionaryContent)
         {
             PlainXmlSerializer.WriteStartElementWithType(writer, propertyName, propertyTypeName);
             ((DictionaryContent)propertyValue).WritePropertyContentsTo(writer);
             writer.WriteEndElement();
         }
         else
         {
             string propertyText = (string)propertyValue;
             PlainXmlSerializer.WriteTextValue(writer, propertyName, propertyTypeName, propertyText);
         }
     }
 }