/// <summary> /// Writes this element binary to the writer. /// </summary> /// <param name="writer">The <see cref="T:CE.iPhone.PListBinaryWriter"/> to which the element is written.</param> /// <remarks>Provided for internal use only.</remarks> public abstract void WriteBinary(PListBinaryWriter writer);
/// <summary> /// Writes this element binary to the writer. /// </summary> /// <param name="writer">The <see cref="T:CE.iPhone.PListBinaryWriter"/> to which the element is written.</param> /// <remarks>Provided for internal use only.</remarks> public void WriteBinary(PListBinaryWriter writer) { }
/// <summary> /// Saves the PList to the specified stream. /// </summary> /// <param name="stream">The stream in which the PList is saves.</param> /// <param name="format">The format of the PList (Binary/Xml).</param> public void Save(Stream stream, PListFormat format) { if (format == PListFormat.Xml) { XmlWriterSettings sets = new XmlWriterSettings(); sets.Encoding = Encoding.UTF8; sets.Indent = true; sets.IndentChars = "\t"; sets.NewLineChars = "\n"; XmlWriter xmlWriter = XmlTextWriter.Create(stream, sets); xmlWriter.WriteStartDocument(); xmlWriter.WriteDocType("plist", "-//Apple Computer//DTD PLIST 1.0//EN", "http://www.apple.com/DTDs/PropertyList-1.0.dtd", null); WriteXml(xmlWriter); xmlWriter.Flush(); } else { PListBinaryWriter writer = new PListBinaryWriter(); writer.Write(stream, Root); } }