Beispiel #1
0
        // Make sure there is a part to write to and that it contains
        // the expected start markup.
        private void EnsureXmlWriter()
        {
            if (_xmlWriter != null)
            {
                return;
            }

            EnsurePropertyPart(); // Should succeed or throw an exception.

            Stream writerStream = new IgnoreFlushAndCloseStream(_propertyPart.GetStream(FileMode.Create, FileAccess.Write));

            _xmlWriter = XmlWriter.Create(writerStream, new XmlWriterSettings {
                Encoding = System.Text.Encoding.UTF8
            });
            WriteXmlStartTagsForPackageProperties();
        }
        // Make sure there is a part to write to and that it contains
        // the expected start markup.
        private void EnsureXmlWriter()
        {
            if (_xmlWriter != null)
                return;

            EnsurePropertyPart(); // Should succeed or throw an exception.

            Stream writerStream = new IgnoreFlushAndCloseStream(_propertyPart.GetStream(FileMode.Create, FileAccess.Write));
            _xmlWriter = XmlWriter.Create(writerStream, new XmlWriterSettings { Encoding = System.Text.Encoding.UTF8 });
            WriteXmlStartTagsForPackageProperties();
        }