示例#1
0
 protected override void Commit()
 {
     if (ctSettings == null)
     {
         throw new InvalidOperationException("Unable to write out settings that were never read in!");
     }
     /*XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS);
     xmlOptions.SaveSyntheticDocumentElement=(new QName(CTSettings.type.Name.NamespaceURI, "settings"));
     Dictionary<String, String> map = new Dictionary<String, String>();
     map.Put("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "w");
     xmlOptions.SaveSuggestedPrefixes=(map);*/
     XmlSerializerNamespaces namespaces = new XmlSerializerNamespaces(new XmlQualifiedName[] {
         new XmlQualifiedName("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main")});
     PackagePart part = GetPackagePart();
     using (Stream out1 = part.GetOutputStream())
     {
         SettingsDocument sd = new SettingsDocument(ctSettings);
         sd.Save(out1);
     }
 }
示例#2
0
        protected override void Commit()
        {

            /*XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS);
            xmlOptions.SaveSyntheticDocumentElement=(new QName(CTSettings.type.Name.NamespaceURI, "settings"));
            Dictionary<String, String> map = new Dictionary<String, String>();
            map.Put("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "w");
            xmlOptions.SaveSuggestedPrefixes=(map);*/
            XmlSerializerNamespaces namespaces = new XmlSerializerNamespaces(new[] {
                new XmlQualifiedName("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main")});
            PackagePart part = GetPackagePart();
            Stream out1 = part.GetOutputStream();
            SettingsDocument sd = new SettingsDocument(ctSettings);
            sd.Save(out1, namespaces);
            out1.Close();
        }