Ejemplo n.º 1
0
        /// <summary>
        /// Saves the XmlDocument into the package at the specified Uri.
        /// </summary>
        /// <param name="uri">The Uri of the component</param>
        /// <param name="xmlDoc">The XmlDocument to save</param>
        internal void SavePart(Uri uri, XmlDocument xmlDoc)
        {
            Packaging.ZipPackagePart part = _package.GetPart(uri);
            var stream = part.GetStream(FileMode.Create, FileAccess.Write);
            var xr     = new XmlTextWriter(stream, Encoding.UTF8);

            xr.Formatting = Formatting.None;

            xmlDoc.Save(xr);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Saves the XmlDocument into the package at the specified Uri.
 /// </summary>
 /// <param name="uri">The Uri of the component</param>
 /// <param name="xmlDoc">The XmlDocument to save</param>
 internal void SavePart(Uri uri, XmlDocument xmlDoc)
 {
     Packaging.ZipPackagePart part = _package.GetPart(uri);
     xmlDoc.Save(part.GetStream(FileMode.Create, FileAccess.Write));
 }