コード例 #1
0
        /// <summary>
        ///     Writes the specified <see cref="IPlistSerializable" /> object to the given stream as a binary plist.
        /// </summary>
        /// <param name="stream">The stream to write to.</param>
        /// <param name="obj">The <see cref="IPlistSerializable" /> object to write.</param>
        /// <param name="closeStream">A value indicating whether to close the stream after the write operation completes.</param>
        public void WriteObject(Stream stream, IPlistSerializable obj, bool closeStream)
        {
            if (obj == null)
            {
                throw new ArgumentNullException(nameof(obj), "obj cannot be null.");
            }

            WriteObject(stream, obj.ToPlistDictionary(), closeStream);
        }
コード例 #2
0
        /// <summary>
        /// Writes the specified <see cref="IPlistSerializable"/> object to the given stream as a binary plist.
        /// </summary>
        /// <param name="stream">The stream to write to.</param>
        /// <param name="obj">The <see cref="IPlistSerializable"/> object to write.</param>
        /// <param name="closeStream">A value indicating whether to close the stream after the write operation completes.</param>
        public void WriteObject(Stream stream, IPlistSerializable obj, bool closeStream)
        {
            if (obj == null)
            {
                throw new ArgumentNullException("obj", "obj cannot be null.");
            }

            this.WriteObject(stream, obj.ToPlistDictionary(), closeStream);
        }