當前位置: 首頁>>代碼示例>>C#>>正文


C# Xml.XmlDictionaryWriter類代碼示例

本文整理匯總了C#中System.Xml.XmlDictionaryWriter的典型用法代碼示例。如果您正苦於以下問題:C# XmlDictionaryWriter類的具體用法?C# XmlDictionaryWriter怎麽用?C# XmlDictionaryWriter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


XmlDictionaryWriter類屬於System.Xml命名空間,在下文中一共展示了XmlDictionaryWriter類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: AddPrefixIfNeeded

		protected virtual void AddPrefixIfNeeded(XmlDictionaryWriter writer, string prefix, string ns)
		{
			if (writer.LookupPrefix(ns) == null)
			{
				writer.WriteXmlnsAttribute(prefix, ns);
			}
		}
開發者ID:nickchal,項目名稱:pash,代碼行數:7,代碼來源:AdwsRequestMsg.cs

示例2: WriteObject

 public override void WriteObject(XmlDictionaryWriter writer, object graph)
 {
     if (_isSerializerSetExplicit)
         _serializer.Serialize(writer, new object[] { graph });
     else
         _serializer.Serialize(writer, graph);
 }
開發者ID:SoumikMukherjeeDOTNET,項目名稱:wcf,代碼行數:7,代碼來源:XmlSerializerObjectSerializer.cs

示例3: OnWriteBodyContents

 protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
 {
     using (XmlWriterBackedStream stream = new XmlWriterBackedStream(writer))
     {
         OnWriteBodyContents(stream);
     }
 }
開發者ID:JianwenSun,項目名稱:cc,代碼行數:7,代碼來源:StreamBodyWriter.cs

示例4: WriteChunkCallback

 void WriteChunkCallback(XmlDictionaryWriter writer, object state)
 {
     ChunkState chunkState = (ChunkState)state;
     writer.WriteStartElement(ChunkingUtils.ChunkElement, ChunkingUtils.ChunkNs);
     writer.WriteBase64(chunkState.Buffer, 0, chunkState.Count);
     writer.WriteEndElement();
 }
開發者ID:spzenk,項目名稱:sfdocsamples,代碼行數:7,代碼來源:ChunkingWriter.cs

示例5: OnWriteBodyContents

 protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
 {
     if (_data != null && _data.Length > 0)
     {
         writer.WriteElementString("BODY", _data);
     }
 }
開發者ID:SoumikMukherjeeDOTNET,項目名稱:wcf,代碼行數:7,代碼來源:ContentOnlyMessage.cs

示例6: OnWriteBodyContents

 protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
 {
     writer.WriteStartElement("Binary");
     byte[] buffer = JSONPSupportInspector.encoding.GetBytes(this.content);
     writer.WriteBase64(buffer, 0, buffer.Length);
     writer.WriteEndElement();
 }
開發者ID:SK-Marten,項目名稱:SimpleCQRS,代碼行數:7,代碼來源:JSONPSupportBehavior.cs

示例7: SerializeAsync

 internal async Task SerializeAsync(XmlDictionaryWriter writer, object[] parameters, object returnValue)
 {
     Stream streamValue = await GetStreamAndWriteStartWrapperIfNecessaryAsync(writer, parameters, returnValue);
     var streamProvider = new OperationStreamProvider(streamValue);
     await StreamFormatterHelper.WriteValueAsync(writer, streamProvider);
     await WriteEndWrapperIfNecessaryAsync(writer);
 }
開發者ID:dmetzgar,項目名稱:wcf,代碼行數:7,代碼來源:StreamFormatter.cs

示例8: WriteAckRanges

 internal static void WriteAckRanges(XmlDictionaryWriter writer, ReliableMessagingVersion reliableMessagingVersion, UniqueId sequenceId, SequenceRangeCollection ranges)
 {
     WsrmFeb2005Dictionary dictionary = XD.WsrmFeb2005Dictionary;
     XmlDictionaryString namespaceUri = WsrmIndex.GetNamespace(reliableMessagingVersion);
     writer.WriteStartElement(dictionary.Identifier, namespaceUri);
     writer.WriteValue(sequenceId);
     writer.WriteEndElement();
     if (ranges.Count == 0)
     {
         if (reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessagingFebruary2005)
         {
             ranges = ranges.MergeWith((long) 0L);
         }
         else if (reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11)
         {
             writer.WriteStartElement(DXD.Wsrm11Dictionary.None, namespaceUri);
             writer.WriteEndElement();
         }
     }
     for (int i = 0; i < ranges.Count; i++)
     {
         writer.WriteStartElement(dictionary.AcknowledgementRange, namespaceUri);
         writer.WriteStartAttribute(dictionary.Lower, null);
         SequenceRange range = ranges[i];
         writer.WriteValue(range.Lower);
         writer.WriteEndAttribute();
         writer.WriteStartAttribute(dictionary.Upper, null);
         SequenceRange range2 = ranges[i];
         writer.WriteValue(range2.Upper);
         writer.WriteEndAttribute();
         writer.WriteEndElement();
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:33,代碼來源:WsrmAcknowledgmentHeader.cs

示例9: OnWriteAddressHeaderContents

        protected override void OnWriteAddressHeaderContents (XmlDictionaryWriter writer)
        {
            writer.WriteStartElement(XD.DotNetAtomicTransactionExternalDictionary.LocalTransactionId,
                                     XD.DotNetAtomicTransactionExternalDictionary.Namespace);

            writer.WriteValue(this.transactionId);
            writer.WriteEndElement();

            if (this.contextId != null)
            {
                writer.WriteStartElement(XD.DotNetAtomicTransactionExternalDictionary.ContextId,
                                         XD.DotNetAtomicTransactionExternalDictionary.Namespace);

                writer.WriteValue(this.contextId);
                writer.WriteEndElement();
            }

            if (this.tokenId != null)
            {
                writer.WriteStartElement(XD.DotNetAtomicTransactionExternalDictionary.TokenId,
                                         XD.DotNetAtomicTransactionExternalDictionary.Namespace);

                writer.WriteValue(this.tokenId);
                writer.WriteEndElement();
            }
        }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:26,代碼來源:WsatRegistrationHeader.cs

示例10: WriteObject

 public override void WriteObject(XmlDictionaryWriter writer, object graph)
 {
     var data = EncodeObject(graph);
     writer.WriteStartElement("Data");
     writer.WriteBase64(data, 0, data.Length);
     writer.WriteEndElement();
 }
開發者ID:cg123,項目名稱:xenko,代碼行數:7,代碼來源:XenkoXmlObjectSerializer.cs

示例11: WriteAdditionalAttributes

 protected override void WriteAdditionalAttributes(XmlDictionaryWriter writer)
 {
     if (this.recipient != null)
     {
         writer.WriteAttributeString(RecipientAttribute, null, this.recipient);
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:7,代碼來源:EncryptedKey.cs

示例12: WriteEndObject

 public override void WriteEndObject(XmlDictionaryWriter writer)
 {
     if (!skipName)
     {
         writer.WriteEndElement();
     }
 }
開發者ID:alexcassol,項目名稱:Terraria-s-Dedicated-Server-Mod,代碼行數:7,代碼來源:DiffSerializer.cs

示例13: OnWriteStartAddressHeader

 protected override void OnWriteStartAddressHeader(XmlDictionaryWriter writer)
 {
     XmlDictionaryReader addressHeaderReader = this.GetAddressHeaderReader();
     writer.WriteStartElement(addressHeaderReader.Prefix, addressHeaderReader.LocalName, addressHeaderReader.NamespaceURI);
     writer.WriteAttributes(addressHeaderReader, false);
     addressHeaderReader.Close();
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:7,代碼來源:BufferedAddressHeader.cs

示例14: WriteJson

            public void WriteJson(XmlDictionaryWriter writer)
            {
                writer.WriteStartElement(MetadataStrings.TypeString);
                writer.WriteAttributeString("type", "string");
                writer.WriteString(String.Format("{0}{1}{2}", this.TypeName, MetadataStrings.NamespaceMarker, this.TypeNamespace));
                writer.WriteEndElement();

                writer.WriteStartElement(MetadataStrings.KeyString);
                writer.WriteAttributeString("type", "array");
                foreach (string keyitem in this.Key)
                {
                    writer.WriteStartElement("item");
                    writer.WriteAttributeString("type", "string");
                    writer.WriteValue(keyitem);
                    writer.WriteEndElement();
                }
                writer.WriteEndElement();

                writer.WriteStartElement(MetadataStrings.FieldsString);
                writer.WriteAttributeString("type", "object");
                foreach (TypePropertyMetadata field in this.Properties)
                {
                    field.WriteJson(writer);
                }
                writer.WriteEndElement();

                this.WriteValidationRulesMetadata(writer);
            }
開發者ID:OpenRIAServices,項目名稱:OpenRiaServices,代碼行數:28,代碼來源:ServiceMetadataGenerator.cs

示例15: Serialize

		internal static void Serialize(MessageDictionary messageDictionary, XmlDictionaryWriter writer) {
			Requires.NotNull(messageDictionary, "messageDictionary");
			Requires.NotNull(writer, "writer");

			writer.WriteStartElement("root");
			writer.WriteAttributeString("type", "object");
			foreach (var pair in messageDictionary) {
				bool include = false;
				string type = "string";
				MessagePart partDescription;
				if (messageDictionary.Description.Mapping.TryGetValue(pair.Key, out partDescription)) {
					Contract.Assume(partDescription != null);
					if (partDescription.IsRequired || partDescription.IsNondefaultValueSet(messageDictionary.Message)) {
						include = true;
						if (IsNumeric(partDescription.MemberDeclaredType)) {
							type = "number";
						} else if (partDescription.MemberDeclaredType.IsAssignableFrom(typeof(bool))) {
							type = "boolean";
						}
					}
				} else {
					// This is extra data.  We always write it out.
					include = true;
				}

				if (include) {
					writer.WriteStartElement(pair.Key);
					writer.WriteAttributeString("type", type);
					writer.WriteString(pair.Value);
					writer.WriteEndElement();
				}
			}

			writer.WriteEndElement();
		}
開發者ID:rafek,項目名稱:dotnetopenid,代碼行數:35,代碼來源:MessageSerializer.cs


注:本文中的System.Xml.XmlDictionaryWriter類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。