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


C# XmlWriter.WriteRaw方法代码示例

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


在下文中一共展示了XmlWriter.WriteRaw方法的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: WriteTo

        public override void WriteTo(XmlWriter w)
        {
            Debug.Assert (this.expression != null);
            Debug.Assert (w != null);

            w.WriteRaw (this.expression);
        }
开发者ID:Sandwych,项目名称:maltreport,代码行数:7,代码来源:ReferenceElement.cs

示例3: Generate

		public override void Generate(XmlWriter writer)
		{
			writer.WriteRaw("<?xml version=\"1.0\"?>");
			writer.WriteStartElement(@"response", @"http://schemas.microsoft.com/2006/09/sip/mrasp");

			if (Request != null)
			{
				writer.WriteAttributeString(@"requestID", Request.RequestId);
				writer.WriteAttributeString(@"version", Request.Version);
			}
			
			writer.WriteAttributeString(@"serverVersion", ServerVersion);
			
			if (Request != null)
			{
				writer.WriteAttributeString(@"to", Request.To);
				writer.WriteAttributeString(@"from", Request.From);
			}
			
			writer.WriteAttributeString(@"reasonPhrase", Common.ToString(ReasonPhrase));

			if (CredentialsResponses != null)
				foreach (var credentialsResponse in CredentialsResponses)
					credentialsResponse.Generate(writer);

			writer.WriteEndElement();
		}
开发者ID:hungdluit,项目名称:sipserver,代码行数:27,代码来源:Response.cs

示例4: WriteXml

		/// <summary>
		/// Writes the configuration section values as an XML element to an <see cref="XmlWriter"/>.
		/// </summary>
		/// <param name="writer">The <see cref="XmlWriter"/> that writes to the configuration source.</param>
		public void WriteXml(XmlWriter writer)
        {
            if (writer == null) throw new ArgumentNullException("writer");

			String serialized = SerializeSection(this, "SerializableConfigurationSection", ConfigurationSaveMode.Full);
			writer.WriteRaw(serialized);
		}
开发者ID:jmeckley,项目名称:Enterprise-Library-5.0,代码行数:11,代码来源:SerializableConfigurationSection.cs

示例5: WriteElement

        private void WriteElement(XNode node, XmlWriter writer)
        {
            writer.WriteStartElement(node.Name);

            foreach (var attr in node.Attributes)
            {
                if (attr.Match == MatchType.Change || attr.Match == MatchType.NoMatch)
                    writer.WriteAttributeString(attr.Name, attr.XmlNode.Value);
            }

            foreach (var text in node.Texts)
            {
                if (text.Match == MatchType.Change || text.Match == MatchType.NoMatch)
                    writer.WriteValue(text.XmlNode.Value);
            }

            foreach (var element in node.Elements)
            {
                if (element.Match == MatchType.Change)
                    WriteElement(element, writer);

                if (element.Match == MatchType.NoMatch)
                    writer.WriteRaw(element.XmlNode.OuterXml);
            }

            writer.WriteEndElement();
        }
开发者ID:clone278,项目名称:FatAntelope,代码行数:27,代码来源:DebugDiffWriter.cs

示例6: SaveValue

 internal override void SaveValue (XmlWriter writer)
 {
         base.SaveValue (writer);
         SaveAttribute (writer, "Evaluate", Evaluate);
         if (!string.IsNullOrWhiteSpace (TaskBody))
                 writer.WriteRaw (TaskBody);
 }
开发者ID:anand-bhola,项目名称:mono,代码行数:7,代码来源:ProjectUsingTaskBodyElement.cs

示例7: Generate

		public override void Generate(XmlWriter writer1)
		{
			this.writer.Flush();
			this.writer.Close();

			writer1.WriteRaw(output.ToString());
		}
开发者ID:hungdluit,项目名称:sipserver,代码行数:7,代码来源:Rlmi.cs

示例8: GetType

        /// <summary>
        /// Converts an object into its XML representation.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Xml.XmlWriter"/> stream to which the object is serialized.</param>
        void IXmlSerializable.WriteXml(XmlWriter writer)
        {
            var type = GetType();

            var element = new XElement(type.Name);
            var serializer = SerializationFactory.GetXmlSerializer();
            serializer.Serialize(this, new XmlSerializationContextInfo(element, this));

            // The serializer gives us the full element, but we only need the actual content. According to
            // http://stackoverflow.com/questions/3793/best-way-to-get-innerxml-of-an-xelement, this method is the fastest:
            var reader = element.CreateReader();
            reader.MoveToContent();

            // CTL-710: fix attributes on top level elements
            if (reader.HasAttributes)
            {
                for (int i = 0; i < reader.AttributeCount; i++)
                {
                    reader.MoveToAttribute(i);

                    var attributePrefix = reader.Prefix;
                    var attributeLocalName = reader.LocalName;
                    var attributeNs = reader.NamespaceURI;
                    var attributeValue = reader.Value;

                    writer.WriteAttributeString(attributePrefix, attributeLocalName, attributeNs, attributeValue);
                }

                reader.MoveToElement();
            }

            var elementContent = reader.ReadInnerXml();

            writer.WriteRaw(elementContent);
        }
开发者ID:matthijskoopman,项目名称:Catel,代码行数:39,代码来源:ModelBase.serialization.xml.cs

示例9: AddEntry

        private void AddEntry(XmlWriter writer, Package package, string baseUrl)
        {
            writer.WriteStartElement("entry");

            writer.WriteElementString("id", package.ID);

            writer.WriteStartElement("title");
            writer.WriteAttributeString("type", "text");
            writer.WriteValue(package.Name);
            writer.WriteEndElement(); // title

            writer.WriteStartElement("link");
            writer.WriteAttributeString("rel", "alternate");
            writer.WriteAttributeString("href", baseUrl + "/extensions/" + package.ID + "/extension.vsix");
            writer.WriteEndElement(); // link

            writer.WriteStartElement("summary");
            writer.WriteAttributeString("type", "text");
            writer.WriteValue(package.Description);
            writer.WriteEndElement(); // summary

            writer.WriteElementString("published", package.DatePublished.ToString("yyyy-MM-ddTHH:mm:ssZ"));
            writer.WriteElementString("updated", package.DatePublished.ToString("yyyy-MM-ddTHH:mm:ssZ"));

            writer.WriteStartElement("author");
            writer.WriteElementString("name", package.Author);
            writer.WriteEndElement(); // author

            writer.WriteStartElement("content");
            writer.WriteAttributeString("type", "application/octet-stream");
            writer.WriteAttributeString("src", baseUrl + "/extensions/" + package.ID + "/extension.vsix");
            writer.WriteEndElement(); // content

            writer.WriteRaw("\r\n<Vsix xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://schemas.microsoft.com/developer/vsx-syndication-schema/2010\">\r\n");

            writer.WriteElementString("Id", package.ID);
            writer.WriteElementString("Version", package.Version);

            writer.WriteStartElement("References");
            writer.WriteEndElement();

            writer.WriteRaw("</Vsix>");// Vsix
            writer.WriteEndElement(); // entry
        }
开发者ID:japj,项目名称:ExtensionGallery,代码行数:44,代码来源:FeedWriter.cs

示例10: Write

 private void Write(IRssSource src, XmlWriter writer)
 {
     if (src.IsRetranslator)
     {
         writer.WriteRaw(src.GetRaw());
     }
     else{
         writeEmbeded(src, writer);
     }
 }
开发者ID:Qorpent,项目名称:comdiv.oldcore,代码行数:10,代码来源:DefaultRssWriter.cs

示例11: WriteXml

        /// <summary>
        /// Serializes the configuration section into XML and writes to an XML writer object.
        /// </summary>
        /// <param name="writer">The XML writer object.</param>
        public virtual void WriteXml(XmlWriter writer)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }

            var serializedSection = SerializeSection(this, GetConfigurationSectionName(), ConfigurationSaveMode.Full);
            writer.WriteRaw(serializedSection);
        }
开发者ID:devaccelerate,项目名称:core,代码行数:14,代码来源:DaConfigurationSection.cs

示例12: generateXml

 private void generateXml(XmlWriter writer)
 {
     writer.WriteStartDocument();
     writer.WriteStartElement("results");
     foreach (var runner in _results.GroupBy(x => x.Runner))
     {
         writer.WriteStartElement("runner");
         writer.WriteAttributeString("id", runner.Key);
         foreach (var assembly in runner.GroupBy(x => x.Assembly))
         {
             writer.WriteStartElement("assembly");
             writer.WriteAttributeString("name", assembly.Key);
             foreach (var fixture in assembly.GroupBy(x => x.TestFixture))
             {
                 writer.WriteStartElement("fixture");
                 writer.WriteAttributeString("name", fixture.Key);
                 foreach (var test in fixture)
                 {
                     writer.WriteStartElement("test");
                     writer.WriteAttributeString("state", test.State.ToString());
                     writer.WriteAttributeString("name", test.TestName);
                     if (test.TestDisplayName != null)
                         writer.WriteAttributeString("displayName", test.TestDisplayName);
                     writer.WriteAttributeString("duration", test.DurationInMilliseconds.ToString());
                     writer.WriteStartElement("message");
                     writer.WriteCData(test.Message);
                     writer.WriteEndElement();
                     if (test.State == TestState.Failed || test.State == TestState.Ignored)
                     {
                         writer.WriteStartElement("stack-trace");
                         foreach (var line in test.StackLines)
                         {
                             writer.WriteStartElement("line");
                             writer.WriteStartElement("method");
                             writer.WriteCData(line.Method);
                             writer.WriteEndElement();
                             writer.WriteStartElement("file");
                             writer.WriteAttributeString("line", line.Line.ToString());
                             writer.WriteRaw(line.File);
                             writer.WriteEndElement();
                             writer.WriteEndElement();
                         }
                         writer.WriteEndElement();
                     }
                     writer.WriteEndElement();
                 }
                 writer.WriteEndElement();
             }
             writer.WriteEndElement();
         }
         writer.WriteEndElement();
     }
     writer.WriteEndElement();
 }
开发者ID:JamesTryand,项目名称:AutoTest.Net,代码行数:54,代码来源:ResultsXmlWriter.cs

示例13: WriteContentsTo

 protected override void WriteContentsTo(XmlWriter writer)
 {
     string data = this.text ?? string.Empty;
     if (this.textKind == TextSyndicationContentKind.XHtml)
     {
         writer.WriteRaw(data);
     }
     else
     {
         writer.WriteString(data);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:12,代码来源:TextSyndicationContent.cs

示例14: buildXml

        public void buildXml(XmlWriter xmlWriter)
        {
            xmlWriter.WriteStartElement("eventDate");

            foreach (DateTime item in eventDates_)
            {
                //xmlWriter.WriteRaw(item.buildXml().ToString());
                xmlWriter.WriteRaw("Not implemented");
            }

            xmlWriter.WriteEndElement();

        }
开发者ID:minikie,项目名称:OTCDerivativesCalculatorModule,代码行数:13,代码来源:EventDateViewModel.cs

示例15: buildXml

        public void buildXml(XmlWriter xmlWriter)
        {
            xmlWriter.WriteStartElement("functionEvents");

            foreach (EventFunctionMModel item in eventFunctionMList_)
            {
                item.buildXml(xmlWriter);
            }

            xmlWriter.WriteRaw(jointFunctionEventModel_.buildXml().ToString());

            xmlWriter.WriteEndElement();
        }
开发者ID:minikie,项目名称:OTCDerivativesCalculatorModule,代码行数:13,代码来源:FunctionEventViewModel.cs


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