Ejemplo n.º 1
0
        /// <summary>
        /// Used to save the EntryLink instance into the passed in xmlwriter
        /// </summary>
        /// <param name="writer">the XmlWriter to write into</param>
        public void Save(XmlWriter writer)
        {
            if (Utilities.IsPersistable(this.Href) ||
                this.readOnlySet ||
                this.entry != null)
            {
                writer.WriteStartElement(XmlPrefix, XmlName, XmlNameSpace);
                if (Utilities.IsPersistable(this.Href))
                {
                    writer.WriteAttributeString(GDataParserNameTable.XmlAttributeHref, this.Href);
                }
                if (Utilities.IsPersistable(this.Rel))
                {
                    writer.WriteAttributeString(GDataParserNameTable.XmlAttributeRel, this.Rel);
                }
                if (this.readOnlySet)
                {
                    writer.WriteAttributeString(GDataParserNameTable.XmlAttributeReadOnly,
                                                Utilities.ConvertBooleanToXSDString(this.ReadOnly));
                }

                if (entry != null)
                {
                    entry.SaveToXml(writer);
                }
                writer.WriteEndElement();
            }
        }