当前位置: 首页>>代码示例>>C#>>正文


C# XmlWriter.WriteEndDocument方法代码示例

本文整理汇总了C#中System.Xml.XmlWriter.WriteEndDocument方法的典型用法代码示例。如果您正苦于以下问题:C# XmlWriter.WriteEndDocument方法的具体用法?C# XmlWriter.WriteEndDocument怎么用?C# XmlWriter.WriteEndDocument使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.XmlWriter的用法示例。


在下文中一共展示了XmlWriter.WriteEndDocument方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WriteResponseMessage

        public void WriteResponseMessage ( XmlWriter writer, string innerXml, NuxleusAsyncResult asyncResult ) {

            using (writer) {
                writer.WriteStartDocument();
                if (m_responseType == ResponseType.REDIRECT) {
                    writer.WriteProcessingInstruction("xml-stylesheet", "type='text/xsl' href='/service/transform/openid-redirect.xsl'");
                }
                writer.WriteStartElement("auth");
                writer.WriteAttributeString("xml:base", "http://dev.amp.fm/");
                writer.WriteAttributeString("status", m_status);
                if (m_responseType == ResponseType.REDIRECT) {
                    writer.WriteElementString("url", "http://dev.amp.fm/");
                }
                if (m_responseType == ResponseType.QUERY_RESPONSE && innerXml != null) {
                    writer.WriteStartElement("response");
                    writer.WriteRaw(innerXml);
                    writer.WriteEndElement();
                }
                writer.WriteEndElement();
                writer.WriteEndDocument();
            }

            asyncResult.CompleteCall();

        }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:25,代码来源:Message.cs

示例2: Minimize

        // ----------------------------------------------------------
        public void Minimize(Options aOptions, Def aDef)
        {
            // reader
            _reader = new XmlDocument();
            _reader.Load(aOptions.inFile);

            // writter with write settings
            var writterSettings = new XmlWriterSettings();
            if (aOptions.prettyPrint) {
                writterSettings.Indent = true;
                writterSettings.IndentChars = "  ";
            }
            _writer = XmlWriter.Create(aOptions.outFile, writterSettings);

            _writer.WriteStartDocument();

            ProcessElement(_reader.DocumentElement, aDef);

            _writer.WriteEndDocument();
            _writer.Close();

            // print warnings
            foreach(string warning in _warnings) {
                Console.WriteLine(warning);
            }
        }
开发者ID:SBCGames,项目名称:SpriterMinimizer,代码行数:27,代码来源:XmlMinimizer.cs

示例3: Write

        public void Write()
        {
            XmlWriterSettings xmlSetting = new XmlWriterSettings();
            xmlSetting.CloseOutput = true;
            xmlSetting.Encoding = Encoding.UTF8;
            xmlSetting.Indent = true;
            xmlSetting.NewLineChars = "\r\n";

            wr = XmlWriter.Create(GeneralConfig.AppDataPath + "Questionaries\\" + questionary.Category + ".xml", xmlSetting);
            wr.WriteStartDocument();
            wr.WriteStartElement("Questionary");
            wr.WriteStartAttribute("category");
            wr.WriteValue(questionary.Category);
            wr.WriteEndAttribute();

            wr.WriteStartAttribute("created");
            wr.WriteValue(questionary.Created.ToString());
            wr.WriteEndAttribute();

            wr.WriteStartAttribute("updated");
            wr.WriteValue(questionary.Updated.ToString());
            wr.WriteEndAttribute();

            wr.WriteStartAttribute("template");
            wr.WriteValue(questionary.TemplateId);
            wr.WriteEndAttribute();

            wr.WriteStartElement("Questions");
            WriteQuestions();
            wr.WriteEndElement();

            wr.WriteEndElement();
            wr.WriteEndDocument();
            wr.Close();
        }
开发者ID:foresightbrand,项目名称:kebibi,代码行数:35,代码来源:QuestionaryWriter.cs

示例4: ExecuteResult

    public override void ExecuteResult(ControllerContext context)
    {
      var response = context.HttpContext.Response;
      response.ClearContent();
      response.ContentType = "text/xml";
      response.AddHeader("Content-Disposition", string.Format("attachment; filename={0}.xml", _exportName));

      var settings = new XmlWriterSettings
        {
          Indent = true,
          Encoding = Encoding.UTF8,
          ConformanceLevel = ConformanceLevel.Document,
          CheckCharacters = true,
          NamespaceHandling = NamespaceHandling.OmitDuplicates
        };
      _writer = XmlWriter.Create(response.OutputStream, settings);
      _writer.WriteStartDocument(true);

      AddItem(_blob, _rootName, true);

      _writer.WriteEndDocument();

      _writer.Flush();
      _writer = null;
    }
开发者ID:glittle,项目名称:TallyJ-v2.0-Archive,代码行数:25,代码来源:Exporter.cs

示例5: WriteBooksToXml

        private static void WriteBooksToXml( XmlWriter writer, List<Book> booklist )
        {
            writer.WriteStartDocument();
              {
            writer.WriteStartElement("bdd", "books", NS); //This adds the root element, <bdd:books>.

            foreach(Book book in booklist) {

              writer.WriteStartElement("bdd", "book", NS); //Adds the element <bdd:book>.
              writer.WriteAttributeString("language", NS, book.Language); //Adding attributes to the element we just started.
              writer.WriteAttributeString("pages", NS, book.Pages);
              {
            writer.WriteElementString("title", NS, book.Title);
            if(book.Subtitle != "")
              writer.WriteElementString("subtitle", NS, book.Subtitle);
            if(book.Authors != null)
              foreach(string author in book.Authors)
                writer.WriteElementString("author", NS, author);
            else
              writer.WriteElementString("author", NS, book.Author);
            writer.WriteElementString("publisher", NS, book.Publisher);
            writer.WriteElementString("year", NS, book.Year);
              }
              writer.WriteEndElement(); //Closes the <bdd:book> element.
            }

            writer.WriteEndElement(); //Closes the <bdd:books> element.
              }
              writer.WriteEndDocument();
        }
开发者ID:jgn-epp,项目名称:Skole,代码行数:30,代码来源:Program.cs

示例6: Serialize

        public void Serialize(DbDatabaseMapping databaseMapping, DbProviderInfo providerInfo, XmlWriter xmlWriter)
        {
            //Contract.Requires(xmlWriter != null);
            //Contract.Requires(databaseMapping != null);
            //Contract.Requires(providerInfo != null);
            Contract.Assert(databaseMapping.Model != null);
            Contract.Assert(databaseMapping.Database != null);

            _xmlWriter = xmlWriter;
            _databaseMapping = databaseMapping;
            _version = databaseMapping.Model.Version;
            _providerInfo = providerInfo;
            _namespace = _version == DataModelVersions.Version3 ? EdmXmlNamespaceV3 : EdmXmlNamespaceV2;

            _xmlWriter.WriteStartDocument();

            using (Element("Edmx", "Version", string.Format(CultureInfo.InvariantCulture, "{0:F1}", _version)))
            {
                WriteEdmxRuntime();
                WriteEdmxDesigner();
            }

            _xmlWriter.WriteEndDocument();
            _xmlWriter.Flush();
        }
开发者ID:jimmy00784,项目名称:entityframework,代码行数:25,代码来源:EdmxSerializer.cs

示例7: EndXML

 // ***************************************************************************
 // Beendet an zu schreiben
 public static void EndXML(XmlWriter writer)
 {
     writer.WriteEndElement();
     writer.WriteEndDocument();
     writer.Flush();
     writer.Close();
 }
开发者ID:StWol,项目名称:Last-Man,代码行数:9,代码来源:XMLManager.cs

示例8: Serialize

        public void Serialize(DbDatabaseMapping databaseMapping, XmlWriter xmlWriter)
        {
            DebugCheck.NotNull(xmlWriter);
            DebugCheck.NotNull(databaseMapping);
            Debug.Assert(databaseMapping.Model != null);
            Debug.Assert(databaseMapping.Database != null);

            _xmlWriter = xmlWriter;
            _databaseMapping = databaseMapping;
            _version = databaseMapping.Model.SchemaVersion;
            _namespace = Equals(_version, XmlConstants.EdmVersionForV3)
                             ? EdmXmlNamespaceV3
                             : (Equals(_version, XmlConstants.EdmVersionForV2) ? EdmXmlNamespaceV2 : EdmXmlNamespaceV1);

            _xmlWriter.WriteStartDocument();

            using (Element("Edmx", "Version", string.Format(CultureInfo.InvariantCulture, "{0:F1}", _version)))
            {
                WriteEdmxRuntime();
                WriteEdmxDesigner();
            }

            _xmlWriter.WriteEndDocument();
            _xmlWriter.Flush();
        }
开发者ID:hallco978,项目名称:entityframework,代码行数:25,代码来源:EdmxSerializer.cs

示例9: Write

 public void Write(XmlWriter writer)
 {
     writer.WriteStartDocument();
     writer.WriteStartElement("Macro");
     writer.WriteAttributeString("Name", "Custom tool");
     WriteInputs(writer);
     WriteResults(writer);
     writer.WriteEndElement();
     writer.WriteEndDocument();
 }
开发者ID:ondrej11,项目名称:o106,代码行数:10,代码来源:MacroSerializer.cs

示例10: WriteXml

        public static void WriteXml(XmlWriter writer, Action writeGraph, string version = CurrentVersion)
        {
            writer.WriteStartDocument();
            writer.WriteStartElement(ElementName, Namespace);
            writer.WriteAttributeString(VersionAttributeName, version);

            writeGraph();

            writer.WriteEndElement();
            writer.WriteEndDocument();
        }
开发者ID:gitter-badger,项目名称:LinksPlatform,代码行数:11,代码来源:Gexf.cs

示例11: FinalizeXslStylesheet

 private static void FinalizeXslStylesheet(XmlWriter writer)
 {
     
     writer.WriteEndElement(); // xsl:for-each
     
     writer.WriteEndElement(); // xsl-template
     
     writer.WriteEndElement(); // xsl:stylesheet
 
     writer.WriteEndDocument();
 
 }
开发者ID:stavrossk,项目名称:RKLib.ExportData,代码行数:12,代码来源:XslStylesheetConstructor.cs

示例12: WriteResponse

        /// <summary>
        /// Serializes an XML-RPC response to a <see cref="System.Xml.XmlWriter"/>.
        /// </summary>
        /// <param name="writer">the <see cref="System.Xml.XmlWriter"/> to write</param>
        /// <param name="response">the <see cref="LX.EasyWeb.XmlRpc.IXmlRpcResponse"/> to serialize</param>
        /// <param name="config">the context configuration</param>
        /// <param name="typeSerializerFactory">the <see cref="LX.EasyWeb.XmlRpc.Serializer.ITypeSerializerFactory"/> to get type serializers</param>
        /// <exception cref="System.Xml.XmlException">failed writing the response XML</exception>
        public void WriteResponse(XmlWriter writer, IXmlRpcResponse response, IXmlRpcStreamRequestConfig config, ITypeSerializerFactory typeSerializerFactory)
        {
            writer.WriteStartDocument();
            writer.WriteStartElement(XmlRpcSpec.METHOD_RESPONSE_TAG);

            if (response.Fault == null)
                RecursiveTypeSerializer.WriteParams(writer, config, typeSerializerFactory, response.Result);
            else
                WriteFaultResponse(writer, response.Fault, config, typeSerializerFactory);

            writer.WriteEndElement();
            writer.WriteEndDocument();
        }
开发者ID:longshine,项目名称:EasyWeb.NET,代码行数:21,代码来源:XmlRpcResponseSerializer.cs

示例13: Render

        protected override void Render(XmlWriter reportBuilder)
        {
            reportBuilder.WriteStartDocument();
            reportBuilder.WriteStartElement("testsuites");

            foreach (var contextByAssembly in ContextsByAssembly)
            {
                Render(reportBuilder, contextByAssembly.Key, contextByAssembly.Value);
            }

            reportBuilder.WriteEndElement();
            reportBuilder.WriteEndDocument();
        }
开发者ID:aloker,项目名称:machine.specifications,代码行数:13,代码来源:JUnitReportGenerator.cs

示例14: Write

		public void Write(XmlWriter writer)
		{
			writer.WriteStartDocument();
			writer.WriteStartElement("netreflector");
			try
			{
				WriteTypes(writer);
			}
			finally
			{
				writer.WriteEndDocument();
			}
		}
开发者ID:modulexcite,项目名称:NetReflector,代码行数:13,代码来源:XmlDocumentationGenerator.cs

示例15: WriteDictionary

 private static void WriteDictionary(ILocalizationDictionary dictionary, XmlWriter writer) {
   writer.WriteStartDocument();
   var typedDictionary = dictionary as LocalizationDictionary;
   if(typedDictionary!=null) {
     WriteIncludes(typedDictionary, writer);
   }
   writer.WriteStartElement("dictionary");
   foreach(var key in dictionary.Keys) {
     WriteKey(key, dictionary, writer);
   }
   writer.WriteEndElement();
   writer.WriteEndDocument();
 }
开发者ID:mios-fi,项目名称:mios.localization,代码行数:13,代码来源:XmlLocalizationWriter.cs


注:本文中的System.Xml.XmlWriter.WriteEndDocument方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。