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


C# XmlDictionaryWriter.WriteNode方法代码示例

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


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

示例1: OnWriteBodyContents

		protected override void OnWriteBodyContents (
			XmlDictionaryWriter writer)
		{
			if (reader == null && String.IsNullOrEmpty (xml))
				return;
			XmlReader r = reader ?? XmlReader.Create (new StringReader (xml));
			r.MoveToContent ();
			writer.WriteNode (r, false);
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:9,代码来源:XmlReaderBodyWriter.cs

示例2: OnWriteBodyContents

 protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
 {
     using (XmlReader reader = new XmlTextReader(this.FileName))
     {
         while (!reader.EOF)
         {
             writer.WriteNode(reader, false);
         }
     }
 }
开发者ID:huoxudong125,项目名称:WCF-Demo,代码行数:10,代码来源:XmlReaderBodyWriter.cs

示例3: OnWriteAddressHeaderContents

 protected override void OnWriteAddressHeaderContents(XmlDictionaryWriter writer)
 {
     XmlDictionaryReader addressHeaderReader = this.GetAddressHeaderReader();
     addressHeaderReader.ReadStartElement();
     while (addressHeaderReader.NodeType != XmlNodeType.EndElement)
     {
         writer.WriteNode(addressHeaderReader, false);
     }
     addressHeaderReader.ReadEndElement();
     addressHeaderReader.Close();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:BufferedAddressHeader.cs

示例4: OnWriteHeaderContents

 protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
 {
     XmlDictionaryReader headerReader = this.GetHeaderReader();
     headerReader.ReadStartElement();
     while (headerReader.NodeType != XmlNodeType.EndElement)
     {
         writer.WriteNode(headerReader, false);
     }
     headerReader.ReadEndElement();
     headerReader.Close();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:ReadableMessageHeader.cs

示例5: OnWriteDetailContents

        /// <summary>
        /// When overridden in a non-abstract derived class, writes the contents of the detail element. 
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Xml.XmlDictionaryWriter"/> used to write the detail element.</param>
        protected override void OnWriteDetailContents(XmlDictionaryWriter writer)
        {
            var prefix = writer.LookupPrefix(this._nameSpace) ?? "web";
            using (var reader = this._messageFault.GetReaderAtDetailContents())
            {
                if ("Error".Equals(reader.LocalName) && string.IsNullOrWhiteSpace(reader.NamespaceURI))
                {
                    writer.WriteStartElement(prefix, "Error", this._nameSpace);
                    reader.Read();

                    // ErrorMessage
                    writer.WriteNode(reader, false);

                    // ErrorNumber
                    writer.WriteNode(reader, false);

                    // 
                    writer.WriteNode(reader, false);
                }
            }
        }
开发者ID:alcardac,项目名称:SDMXRI_WS_OF,代码行数:25,代码来源:SdmxMessageFault.cs

示例6: OnWriteBodyContents

 protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
 {
     using (this.reader)
     {
         for (XmlNodeType type = this.reader.MoveToContent(); !this.reader.EOF && (type != XmlNodeType.EndElement); type = this.reader.MoveToContent())
         {
             if (type != XmlNodeType.Element)
             {
                 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentException(System.ServiceModel.SR.GetString("InvalidReaderPositionOnCreateMessage"), "reader"));
             }
             writer.WriteNode(this.reader, false);
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:14,代码来源:XmlReaderBodyWriter.cs

示例7: OnWriteBodyContents

 protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
 {
     if (!this.isEmpty)
     {
         using (XmlDictionaryReader reader = this.OnGetReaderAtBodyContents())
         {
             if ((reader.ReadState != System.Xml.ReadState.Error) && (reader.ReadState != System.Xml.ReadState.Closed))
             {
                 goto Label_005E;
             }
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.ServiceModel.SR.GetString("MessageBodyReaderInvalidReadState", new object[] { reader.ReadState.ToString() })));
         Label_0056:
             writer.WriteNode(reader, false);
         Label_005E:
             if ((reader.NodeType != XmlNodeType.EndElement) && !reader.EOF)
             {
                 goto Label_0056;
             }
             base.ReadFromBodyContentsToEnd(reader);
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:22,代码来源:ReceivedMessage.cs

示例8: WriteContentsTo10

        void WriteContentsTo10(XmlDictionaryWriter writer)
        {
            // Address
            writer.WriteStartElement(XD.AddressingDictionary.Address, XD.Addressing10Dictionary.Namespace);
            if (isAnonymous)
            {
                writer.WriteString(XD.Addressing10Dictionary.Anonymous);
            }
            else if (isNone)
            {
                writer.WriteString(XD.Addressing10Dictionary.NoneAddress);
            }
            else
            {
                writer.WriteString(this.Uri.AbsoluteUri);
            }
            writer.WriteEndElement();

            // Headers
            if (this.headers != null && this.headers.Count > 0)
            {
                writer.WriteStartElement(XD.AddressingDictionary.ReferenceParameters, XD.Addressing10Dictionary.Namespace);
                this.headers.WriteContentsTo(writer);
                writer.WriteEndElement();
            }

            // Metadata
            if (this.metadataSection >= 0)
            {
                XmlDictionaryReader reader = GetReaderAtSection(this.buffer, metadataSection);
                writer.WriteStartElement(XD.Addressing10Dictionary.Metadata, XD.Addressing10Dictionary.Namespace);
                Copy(writer, reader);
                writer.WriteEndElement();
            }

            // EndpointIdentity
            if (this.Identity != null)
            {
                this.Identity.WriteTo(writer);
            }

            // Extensions
            if (this.extensionSection >= 0)
            {
                XmlDictionaryReader reader = GetReaderAtSection(this.buffer, this.extensionSection);
                while (reader.IsStartElement())
                {
                    if (reader.NamespaceURI == AddressingVersion.WSAddressing10.Namespace)
                    {
                        throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(CreateXmlException(reader, SR.GetString(SR.AddressingExtensionInBadNS, reader.LocalName, reader.NamespaceURI)));
                    }

                    writer.WriteNode(reader, true);
                }
            }
        }
开发者ID:uQr,项目名称:referencesource,代码行数:56,代码来源:EndpointAddress.cs

示例9: WriteTokenCore

 public override void WriteTokenCore(XmlDictionaryWriter writer, SecurityToken token)
 {
     BufferedGenericXmlSecurityToken bufferedXmlToken = token as BufferedGenericXmlSecurityToken;
     if (bufferedXmlToken != null && bufferedXmlToken.TokenXmlBuffer != null)
     {
         using (XmlDictionaryReader reader = bufferedXmlToken.TokenXmlBuffer.GetReader(0))
         {
             writer.WriteNode(reader, false);
         }
     }
     else
     {
         GenericXmlSecurityToken xmlToken = (GenericXmlSecurityToken)token;
         xmlToken.TokenXml.WriteTo(writer);
     }
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:16,代码来源:WSSecurityJan2004.cs

示例10: OnBodyToString

 protected override void OnBodyToString(XmlDictionaryWriter writer)
 {
     using (XmlDictionaryReader reader = GetBufferedReaderAtBody())
     {
         while (reader.NodeType != XmlNodeType.EndElement)
         {
             writer.WriteNode(reader, false);
         }
     }
 }
开发者ID:weshaggard,项目名称:wcf,代码行数:10,代码来源:BinaryMessageEncoder.cs

示例11: WriteNodeToWriter

 public static void WriteNodeToWriter(byte[] buffer, XmlDictionaryWriter writer)
 {
     using (XmlDictionaryReader reader = Utility.CreateReader(buffer))
     {
         writer.WriteNode((XmlReader)reader, false);
     }
 }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:7,代码来源:Utility.cs

示例12: OnWriteHeaderContents

 protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
 {
     XmlDictionaryReader reader = GetHeaderReader();
     reader.ReadStartElement();
     while (reader.NodeType != XmlNodeType.EndElement)
         writer.WriteNode(reader, false);
     reader.ReadEndElement();
     reader.Dispose();
 }
开发者ID:SoumikMukherjeeDOTNET,项目名称:wcf,代码行数:9,代码来源:MessageHeader.cs

示例13: WriteObjectContent

 public override void WriteObjectContent(XmlDictionaryWriter writer, object graph)
 {
     if (writer == null) throw new ArgumentNullException("writer");
     if (writer.WriteState != WriteState.Element)
         throw new SerializationException(string.Format("WriteState '{0}' not valid. Caller must write start element before serializing in contentOnly mode.",
             writer.WriteState));
     using (MemoryStream memoryStream = new MemoryStream())
     {
         using (XmlDictionaryWriter bufferWriter = XmlDictionaryWriter.CreateTextWriter(memoryStream, Encoding.UTF8))
         {
             serializer.Serialize(bufferWriter, graph);
             bufferWriter.Flush();
             memoryStream.Position = 0;
             using (XmlReader reader = new XmlTextReader(memoryStream))
             {
                 reader.MoveToContent();
                 writer.WriteAttributes(reader, false);
                 if (reader.Read()) // move off start node (we want to skip it)
                 {
                     while (reader.NodeType != XmlNodeType.EndElement) // also skip end node.
                         writer.WriteNode(reader, false); // this will take us to the start of the next child node, or the end node.
                     reader.ReadEndElement(); // not necessary, but clean
                 }
             }
         }
     }
 }
开发者ID:NSWPlanning,项目名称:edais,代码行数:27,代码来源:SecurityHeaderFactory.cs

示例14: OnBodyToString

 protected override void OnBodyToString(XmlDictionaryWriter writer)
 {
     using (XmlDictionaryReader reader = this.GetBufferedReaderAtBody())
     {
         if (this.Version == MessageVersion.None)
         {
             writer.WriteNode(reader, false);
         }
         else if (!reader.IsEmptyElement)
         {
             reader.ReadStartElement();
             while (reader.NodeType != XmlNodeType.EndElement)
             {
                 writer.WriteNode(reader, false);
             }
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:18,代码来源:BufferedMessage.cs

示例15: AddReference

        public void AddReference(string headerId, XmlDictionaryReader reader, XmlDictionaryWriter writer)
        {
            HashStream hashStream = this.TakeHashStream();
            writer.StartCanonicalization(hashStream, false, this.InclusivePrefixes);

            // The reader must be positioned on the start element of the header / body we want to canonicalize
            writer.WriteNode(reader, false);
            writer.EndCanonicalization();
            writer.Flush();

            // Add a reference for this block
            this.AddReference(headerId, hashStream.FlushHashAndGetValue());
        }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:13,代码来源:SignatureProcessor.cs


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