/// <summary> /// Serialize this object to the given serializer. /// </summary> public override void WriteTo(IXmlSerializer serializer) { serializer.StartTag(name.NamespaceName, name.LocalName); if (HasAttributes) { foreach (var attr in Attributes()) { attr.WriteTo(serializer); } } if (content is string) { serializer.Text((string)content); } else if (content is XNode) { foreach (var node in Nodes()) { node.WriteTo(serializer); } } serializer.EndTag(name.NamespaceName, name.LocalName); }
/// <summary> /// Serialize this object to the given serializer. /// </summary> public override void WriteTo(IXmlSerializer serializer) { serializer.StartTag(name.NamespaceName, name.LocalName); if (HasAttributes) { foreach (var attr in Attributes()) { attr.WriteTo(serializer); } } if (content is string) { serializer.Text((string) content); } else if (content is XNode) { foreach (var node in Nodes()) { node.WriteTo(serializer); } } serializer.EndTag(name.NamespaceName, name.LocalName); }
/// <summary> /// Serialize this object to the given serializer. /// </summary> public override void WriteTo(IXmlSerializer serializer) { serializer.Text(value); }
/// <summary> /// Serialize this object to the given serializer. /// </summary> public override void WriteTo(IXmlSerializer serializer) { serializer.Text(value); }