当前位置: 首页>>代码示例>>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;未经允许,请勿转载。